home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / DTS Sample Code / Macintosh Sample Code / Monthly Releases (Compressed) / MacDTS.Sample.Code.89.06.sit / SC.001.Sample / Sample.a < prev    next >
MacBinary  |  1989-06-01  |  39.0 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert System V 64-bit library (executable/systemV64BitLibrary) ext Unsupported
1% dexvert COFF Library (other/coffLibrary) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Thu Jun 1 15:56:20 1989, modified Thu Jun 1 15:56:20 1989, creator 'MPS ', type ASCII, 39196 bytes "Sample.a" , at 0x999c 408 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 53 61 6d 70 6c 65 | 2e 61 00 00 00 00 00 00 |..Sample|.a......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 99 1c 00 | 00 01 98 a0 ab 45 64 a0 |........|.....Ed.|
|00000060| ab 45 64 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.Ed.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 2c a5 00 00 |........|....,...|
|00000080| 2a 0d 2a 09 41 70 70 6c | 65 20 4d 61 63 69 6e 74 |*.*.Appl|e Macint|
|00000090| 6f 73 68 20 44 65 76 65 | 6c 6f 70 65 72 20 54 65 |osh Deve|loper Te|
|000000a0| 63 68 6e 69 63 61 6c 20 | 53 75 70 70 6f 72 74 0d |chnical |Support.|
|000000b0| 2a 0d 2a 09 4d 75 6c 74 | 69 46 69 6e 64 65 72 2d |*.*.Mult|iFinder-|
|000000c0| 41 77 61 72 65 20 53 69 | 6d 70 6c 65 20 53 61 6d |Aware Si|mple Sam|
|000000d0| 70 6c 65 20 41 70 70 6c | 69 63 61 74 69 6f 6e 0d |ple Appl|ication.|
|000000e0| 2a 0d 2a 09 53 61 6d 70 | 6c 65 0d 2a 0d 2a 09 53 |*.*.Samp|le.*.*.S|
|000000f0| 61 6d 70 6c 65 2e 61 09 | 2d 09 41 73 73 65 6d 62 |ample.a.|-.Assemb|
|00000100| 6c 65 72 20 53 6f 75 72 | 63 65 0d 2a 0d 2a 09 43 |ler Sour|ce.*.*.C|
|00000110| 6f 70 79 72 69 67 68 74 | 20 a9 20 31 39 38 39 20 |opyright| . 1989 |
|00000120| 41 70 70 6c 65 20 43 6f | 6d 70 75 74 65 72 2c 20 |Apple Co|mputer, |
|00000130| 49 6e 63 2e 0d 2a 09 41 | 6c 6c 20 72 69 67 68 74 |Inc..*.A|ll right|
|00000140| 73 20 72 65 73 65 72 76 | 65 64 2e 0d 2a 0d 2a 09 |s reserv|ed..*.*.|
|00000150| 56 65 72 73 69 6f 6e 73 | 3a 09 0d 2a 09 09 31 2e |Versions|:..*..1.|
|00000160| 30 30 09 09 09 30 38 2f | 38 38 0d 2a 09 09 31 2e |00...08/|88.*..1.|
|00000170| 30 31 09 09 09 31 31 2f | 38 38 0d 2a 09 09 31 2e |01...11/|88.*..1.|
|00000180| 30 32 09 09 09 30 34 2f | 38 39 0d 2a 09 09 31 2e |02...04/|89.*..1.|
|00000190| 30 33 09 09 09 30 36 2f | 38 39 0d 2a 0d 2a 09 43 |03...06/|89.*.*.C|
|000001a0| 6f 6d 70 6f 6e 65 6e 74 | 73 3a 0d 2a 09 09 53 61 |omponent|s:.*..Sa|
|000001b0| 6d 70 6c 65 2e 70 09 09 | 4a 75 6e 65 20 31 2c 20 |mple.p..|June 1, |
|000001c0| 31 39 38 39 0d 2a 09 09 | 53 61 6d 70 6c 65 2e 63 |1989.*..|Sample.c|
|000001d0| 09 09 4a 75 6e 65 20 31 | 2c 20 31 39 38 39 0d 2a |..June 1|, 1989.*|
|000001e0| 09 09 53 61 6d 70 6c 65 | 2e 61 09 09 4a 75 6e 65 |..Sample|.a..June|
|000001f0| 20 31 2c 20 31 39 38 39 | 0d 2a 09 09 53 61 6d 70 | 1, 1989|.*..Samp|
|00000200| 6c 65 2e 69 6e 63 31 2e | 61 09 09 4a 75 6e 65 20 |le.inc1.|a..June |
|00000210| 31 2c 20 31 39 38 39 0d | 2a 09 09 53 61 6d 70 6c |1, 1989.|*..Sampl|
|00000220| 65 4d 69 73 63 2e 61 09 | 09 4a 75 6e 65 20 31 2c |eMisc.a.|.June 1,|
|00000230| 20 31 39 38 39 0d 2a 09 | 09 53 61 6d 70 6c 65 2e | 1989.*.|.Sample.|
|00000240| 72 09 09 4a 75 6e 65 20 | 31 2c 20 31 39 38 39 0d |r..June |1, 1989.|
|00000250| 2a 09 09 53 61 6d 70 6c | 65 2e 68 09 09 4a 75 6e |*..Sampl|e.h..Jun|
|00000260| 65 20 31 2c 20 31 39 38 | 39 0d 2a 09 09 50 53 61 |e 1, 198|9.*..PSa|
|00000270| 6d 70 6c 65 2e 6d 61 6b | 65 09 09 4a 75 6e 65 20 |mple.mak|e..June |
|00000280| 31 2c 20 31 39 38 39 0d | 2a 09 09 43 53 61 6d 70 |1, 1989.|*..CSamp|
|00000290| 6c 65 2e 6d 61 6b 65 09 | 09 4a 75 6e 65 20 31 2c |le.make.|.June 1,|
|000002a0| 20 31 39 38 39 0d 2a 09 | 09 41 53 61 6d 70 6c 65 | 1989.*.|.ASample|
|000002b0| 2e 6d 61 6b 65 09 09 4a | 75 6e 65 20 31 2c 20 31 |.make..J|une 1, 1|
|000002c0| 39 38 39 0d 2a 0d 2a 09 | 53 61 6d 70 6c 65 20 69 |989.*.*.|Sample i|
|000002d0| 73 20 61 6e 20 65 78 61 | 6d 70 6c 65 20 61 70 70 |s an exa|mple app|
|000002e0| 6c 69 63 61 74 69 6f 6e | 20 74 68 61 74 20 64 65 |lication| that de|
|000002f0| 6d 6f 6e 73 74 72 61 74 | 65 73 20 68 6f 77 20 74 |monstrat|es how t|
|00000300| 6f 0d 2a 09 69 6e 69 74 | 69 61 6c 69 7a 65 20 74 |o.*.init|ialize t|
|00000310| 68 65 20 63 6f 6d 6d 6f | 6e 6c 79 20 75 73 65 64 |he commo|nly used|
|00000320| 20 74 6f 6f 6c 62 6f 78 | 20 6d 61 6e 61 67 65 72 | toolbox| manager|
|00000330| 73 2c 20 6f 70 65 72 61 | 74 65 20 0d 2a 09 73 75 |s, opera|te .*.su|
|00000340| 63 63 65 73 73 66 75 6c | 6c 79 20 75 6e 64 65 72 |ccessful|ly under|
|00000350| 20 4d 75 6c 74 69 46 69 | 6e 64 65 72 2c 20 68 61 | MultiFi|nder, ha|
|00000360| 6e 64 6c 65 20 64 65 73 | 6b 20 61 63 63 65 73 73 |ndle des|k access|
|00000370| 6f 72 69 65 73 2c 20 0d | 2a 09 61 6e 64 20 63 72 |ories, .|*.and cr|
|00000380| 65 61 74 65 2c 20 67 72 | 6f 77 2c 20 61 6e 64 20 |eate, gr|ow, and |
|00000390| 7a 6f 6f 6d 20 77 69 6e | 64 6f 77 73 2e 0d 2a 0d |zoom win|dows..*.|
|000003a0| 2a 09 49 74 20 64 6f 65 | 73 20 6e 6f 74 20 62 79 |*.It doe|s not by|
|000003b0| 20 61 6e 79 20 6d 65 61 | 6e 73 20 64 65 6d 6f 6e | any mea|ns demon|
|000003c0| 73 74 72 61 74 65 20 61 | 6c 6c 20 74 68 65 20 74 |strate a|ll the t|
|000003d0| 65 63 68 6e 69 71 75 65 | 73 20 0d 2a 09 79 6f 75 |echnique|s .*.you|
|000003e0| 20 6e 65 65 64 20 66 6f | 72 20 61 20 6c 61 72 67 | need fo|r a larg|
|000003f0| 65 20 61 70 70 6c 69 63 | 61 74 69 6f 6e 2e 20 49 |e applic|ation. I|
|00000400| 6e 20 70 61 72 74 69 63 | 75 6c 61 72 2c 20 53 61 |n partic|ular, Sa|
|00000410| 6d 70 6c 65 20 0d 2a 09 | 64 6f 65 73 20 6e 6f 74 |mple .*.|does not|
|00000420| 20 63 6f 76 65 72 20 65 | 78 63 65 70 74 69 6f 6e | cover e|xception|
|00000430| 20 68 61 6e 64 6c 69 6e | 67 2c 20 6d 75 6c 74 69 | handlin|g, multi|
|00000440| 70 6c 65 20 77 69 6e 64 | 6f 77 73 2f 64 6f 63 75 |ple wind|ows/docu|
|00000450| 6d 65 6e 74 73 2c 20 0d | 2a 09 73 6f 70 68 69 73 |ments, .|*.sophis|
|00000460| 74 69 63 61 74 65 64 20 | 6d 65 6d 6f 72 79 20 6d |ticated |memory m|
|00000470| 61 6e 61 67 65 6d 65 6e | 74 2c 20 70 72 69 6e 74 |anagemen|t, print|
|00000480| 69 6e 67 2c 20 6f 72 20 | 75 6e 64 6f 2e 20 41 6c |ing, or |undo. Al|
|00000490| 6c 20 6f 66 20 0d 2a 09 | 74 68 65 73 65 20 61 72 |l of .*.|these ar|
|000004a0| 65 20 76 69 74 61 6c 20 | 70 61 72 74 73 20 6f 66 |e vital |parts of|
|000004b0| 20 61 20 6e 6f 72 6d 61 | 6c 20 66 75 6c 6c 2d 73 | a norma|l full-s|
|000004c0| 69 7a 65 64 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |ized app|lication|
|000004d0| 2e 0d 2a 0d 2a 09 54 68 | 69 73 20 61 70 70 6c 69 |..*.*.Th|is appli|
|000004e0| 63 61 74 69 6f 6e 20 69 | 73 20 61 6e 20 65 78 61 |cation i|s an exa|
|000004f0| 6d 70 6c 65 20 6f 66 20 | 74 68 65 20 66 6f 72 6d |mple of |the form|
|00000500| 20 6f 66 20 61 20 4d 61 | 63 69 6e 74 6f 73 68 20 | of a Ma|cintosh |
|00000510| 0d 2a 09 61 70 70 6c 69 | 63 61 74 69 6f 6e 3b 20 |.*.appli|cation; |
|00000520| 69 74 20 69 73 20 4e 4f | 54 20 61 20 74 65 6d 70 |it is NO|T a temp|
|00000530| 6c 61 74 65 2e 20 49 74 | 20 69 73 20 4e 4f 54 20 |late. It| is NOT |
|00000540| 69 6e 74 65 6e 64 65 64 | 20 74 6f 20 62 65 20 0d |intended| to be .|
|00000550| 2a 09 75 73 65 64 20 61 | 73 20 61 20 66 6f 75 6e |*.used a|s a foun|
|00000560| 64 61 74 69 6f 6e 20 66 | 6f 72 20 74 68 65 20 6e |dation f|or the n|
|00000570| 65 78 74 20 77 6f 72 6c | 64 2d 63 6c 61 73 73 2c |ext worl|d-class,|
|00000580| 20 62 65 73 74 2d 73 65 | 6c 6c 69 6e 67 2c 20 0d | best-se|lling, .|
|00000590| 2a 09 36 30 30 4b 20 61 | 70 70 6c 69 63 61 74 69 |*.600K a|pplicati|
|000005a0| 6f 6e 2e 20 41 20 73 74 | 69 63 6b 20 66 69 67 75 |on. A st|ick figu|
|000005b0| 72 65 20 64 72 61 77 69 | 6e 67 20 6f 66 20 74 68 |re drawi|ng of th|
|000005c0| 65 20 68 75 6d 61 6e 20 | 62 6f 64 79 20 6d 61 79 |e human |body may|
|000005d0| 20 0d 2a 09 62 65 20 61 | 20 67 6f 6f 64 20 65 78 | .*.be a| good ex|
|000005e0| 61 6d 70 6c 65 20 6f 66 | 20 74 68 65 20 66 6f 72 |ample of| the for|
|000005f0| 6d 20 66 6f 72 20 61 20 | 70 61 69 6e 74 69 6e 67 |m for a |painting|
|00000600| 2c 20 62 75 74 20 74 68 | 61 74 20 64 6f 65 73 20 |, but th|at does |
|00000610| 6e 6f 74 20 0d 2a 09 6d | 65 61 6e 20 69 74 20 73 |not .*.m|ean it s|
|00000620| 68 6f 75 6c 64 20 62 65 | 20 75 73 65 64 20 61 73 |hould be| used as|
|00000630| 20 74 68 65 20 62 61 73 | 69 73 20 66 6f 72 20 74 | the bas|is for t|
|00000640| 68 65 20 6e 65 78 74 20 | 4d 6f 6e 61 20 4c 69 73 |he next |Mona Lis|
|00000650| 61 2e 0d 2a 0d 2a 09 57 | 65 20 72 65 63 6f 6d 6d |a..*.*.W|e recomm|
|00000660| 65 6e 64 20 74 68 61 74 | 20 79 6f 75 20 72 65 76 |end that| you rev|
|00000670| 69 65 77 20 74 68 69 73 | 20 70 72 6f 67 72 61 6d |iew this| program|
|00000680| 20 6f 72 20 54 45 53 61 | 6d 70 6c 65 20 62 65 66 | or TESa|mple bef|
|00000690| 6f 72 65 20 0d 2a 09 62 | 65 67 69 6e 6e 69 6e 67 |ore .*.b|eginning|
|000006a0| 20 61 20 6e 65 77 20 61 | 70 70 6c 69 63 61 74 69 | a new a|pplicati|
|000006b0| 6f 6e 2e 0d 0d 2a 20 54 | 68 69 73 20 65 78 61 6d |on...* T|his exam|
|000006c0| 70 6c 65 20 70 72 6f 67 | 72 61 6d 20 69 73 20 74 |ple prog|ram is t|
|000006d0| 6f 20 62 65 20 63 6f 6e | 73 69 64 65 72 65 64 20 |o be con|sidered |
|000006e0| 61 6e 20 69 6e 74 72 6f | 64 75 63 74 69 6f 6e 20 |an intro|duction |
|000006f0| 74 6f 20 63 6f 64 69 6e | 67 20 69 6e 20 74 68 65 |to codin|g in the|
|00000700| 0d 2a 20 4d 50 57 20 41 | 73 73 65 6d 62 6c 79 20 |.* MPW A|ssembly |
|00000710| 6c 61 6e 67 75 61 67 65 | 2e 20 20 54 68 69 73 20 |language|. This |
|00000720| 73 61 6d 70 6c 65 20 70 | 72 6f 67 72 61 6d 20 64 |sample p|rogram d|
|00000730| 65 6d 6f 6e 73 74 72 61 | 74 65 73 20 74 68 65 20 |emonstra|tes the |
|00000740| 75 73 65 20 6f 66 20 52 | 45 43 4f 52 44 2c 0d 2a |use of R|ECORD,.*|
|00000750| 20 50 52 4f 43 2c 20 57 | 49 54 48 2c 20 4d 41 43 | PROC, W|ITH, MAC|
|00000760| 52 4f 73 2c 20 49 4d 50 | 4f 52 54 2c 20 61 6e 64 |ROs, IMP|ORT, and|
|00000770| 20 6f 74 68 65 72 20 63 | 6f 64 69 6e 67 20 70 72 | other c|oding pr|
|00000780| 61 63 74 69 63 65 73 20 | 75 73 65 64 20 62 79 20 |actices |used by |
|00000790| 4d 50 57 2e 20 20 41 6c | 74 68 6f 75 67 68 0d 2a |MPW. Al|though.*|
|000007a0| 20 74 68 69 73 20 63 6f | 64 65 20 77 69 6c 6c 20 | this co|de will |
|000007b0| 6e 6f 74 20 62 65 20 63 | 6f 6d 70 61 74 69 62 6c |not be c|ompatibl|
|000007c0| 65 20 77 69 74 68 20 6f | 74 68 65 72 20 61 73 73 |e with o|ther ass|
|000007d0| 65 6d 62 6c 65 72 73 2c | 20 74 68 65 72 65 20 69 |emblers,| there i|
|000007e0| 73 20 65 6e 6f 75 67 68 | 20 63 6f 64 65 0d 2a 20 |s enough| code.* |
|000007f0| 63 6f 6e 74 61 69 6e 65 | 64 20 77 69 74 68 69 6e |containe|d within|
|00000800| 20 74 68 65 20 70 72 6f | 63 65 64 75 72 65 73 20 | the pro|cedures |
|00000810| 74 68 61 74 20 64 65 6d | 6f 6e 73 74 72 61 74 65 |that dem|onstrate|
|00000820| 20 36 38 30 30 30 20 70 | 72 6f 67 72 61 6d 6d 69 | 68000 p|rogrammi|
|00000830| 6e 67 20 6f 6e 20 74 68 | 65 20 4d 61 63 2e 0d 0d |ng on th|e Mac...|
|00000840| 2a 20 54 68 65 20 6d 61 | 69 6e 20 70 75 72 70 6f |* The ma|in purpo|
|00000850| 73 65 20 6f 66 20 74 68 | 69 73 20 65 78 61 6d 70 |se of th|is examp|
|00000860| 6c 65 20 69 73 20 74 6f | 20 68 61 76 65 20 61 6e |le is to| have an|
|00000870| 20 65 61 73 79 20 74 6f | 20 75 6e 64 65 72 73 74 | easy to| underst|
|00000880| 61 6e 64 20 73 61 6d 70 | 6c 65 0d 2a 20 61 73 73 |and samp|le.* ass|
|00000890| 65 6d 62 6c 79 20 70 72 | 6f 67 72 61 6d 20 74 68 |embly pr|ogram th|
|000008a0| 61 74 20 66 6f 6c 6c 6f | 77 73 20 76 65 72 79 20 |at follo|ws very |
|000008b0| 63 6c 6f 73 65 6c 79 20 | 74 68 65 20 73 61 6d 65 |closely |the same|
|000008c0| 20 73 61 6d 70 6c 65 20 | 70 72 6f 67 72 61 6d 20 | sample |program |
|000008d0| 61 76 61 69 6c 61 62 6c | 65 0d 2a 20 69 6e 20 50 |availabl|e.* in P|
|000008e0| 61 73 63 61 6c 20 61 6e | 64 20 43 2e 20 20 50 72 |ascal an|d C. Pr|
|000008f0| 6f 67 72 61 6d 6d 65 72 | 73 20 6e 6f 74 20 66 61 |ogrammer|s not fa|
|00000900| 6d 69 6c 69 61 72 20 77 | 69 74 68 20 61 73 73 65 |miliar w|ith asse|
|00000910| 6d 62 6c 79 20 63 6f 64 | 65 20 73 68 6f 75 6c 64 |mbly cod|e should|
|00000920| 20 72 65 66 65 72 20 74 | 6f 0d 2a 20 74 68 65 73 | refer t|o.* thes|
|00000930| 65 20 68 69 67 68 20 6c | 65 76 65 6c 20 76 65 72 |e high l|evel ver|
|00000940| 73 69 6f 6e 73 20 61 6e | 64 20 66 6f 6c 6c 6f 77 |sions an|d follow|
|00000950| 20 74 68 65 20 70 72 6f | 63 65 64 75 72 65 73 20 | the pro|cedures |
|00000960| 77 68 69 6c 65 20 65 78 | 61 6d 69 6e 69 6e 67 20 |while ex|amining |
|00000970| 74 68 65 20 61 73 73 65 | 6d 62 6c 79 0d 2a 20 63 |the asse|mbly.* c|
|00000980| 6f 64 65 2e 20 20 54 68 | 69 73 20 69 73 20 61 20 |ode. Th|is is a |
|00000990| 67 72 65 61 74 20 77 61 | 79 20 74 6f 20 6c 65 61 |great wa|y to lea|
|000009a0| 72 6e 20 68 6f 77 20 74 | 6f 20 72 65 61 64 20 61 |rn how t|o read a|
|000009b0| 73 73 65 6d 62 6c 79 20 | 6c 69 73 74 69 6e 67 73 |ssembly |listings|
|000009c0| 2c 20 61 6e 64 20 74 68 | 61 74 20 69 73 0d 2a 20 |, and th|at is.* |
|000009d0| 74 68 65 20 66 69 72 73 | 74 20 73 74 65 70 20 69 |the firs|t step i|
|000009e0| 6e 20 75 73 69 6e 67 20 | 61 20 64 65 62 75 67 67 |n using |a debugg|
|000009f0| 65 72 2e 0d 0d 2a 20 53 | 74 61 63 6b 20 66 72 61 |er...* S|tack fra|
|00000a00| 6d 65 20 73 74 72 61 74 | 65 67 79 3a 0d 2a 20 2d |me strat|egy:.* -|
|00000a10| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000a20| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000a30| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 0d 2a |--------|------.*|
|00000a40| 20 48 65 72 65 20 69 73 | 20 61 6e 20 65 78 61 6d | Here is| an exam|
|00000a50| 70 6c 65 20 6f 66 20 61 | 20 74 79 70 69 63 61 6c |ple of a| typical|
|00000a60| 20 73 74 61 63 6b 20 66 | 72 61 6d 65 2e 20 20 41 | stack f|rame. A|
|00000a70| 6e 20 65 78 61 6d 70 6c | 65 20 6f 66 20 74 68 65 |n exampl|e of the|
|00000a80| 20 73 74 61 63 6b 20 66 | 72 61 6d 65 0d 2a 20 52 | stack f|rame.* R|
|00000a90| 45 43 4f 52 44 20 69 73 | 20 73 68 6f 77 6e 2e 20 |ECORD is| shown. |
|00000aa0| 20 55 73 69 6e 67 20 74 | 68 69 73 20 73 74 72 61 | Using t|his stra|
|00000ab0| 74 65 67 79 20 66 6f 72 | 20 70 72 6f 63 65 64 75 |tegy for| procedu|
|00000ac0| 72 65 73 20 6d 61 6b 65 | 73 20 6c 69 66 65 20 6d |res make|s life m|
|00000ad0| 75 63 68 20 65 61 73 69 | 65 72 0d 2a 20 77 68 69 |uch easi|er.* whi|
|00000ae0| 6c 65 20 77 72 69 74 69 | 6e 67 20 61 73 73 65 6d |le writi|ng assem|
|00000af0| 62 6c 79 20 63 6f 64 65 | 2e 20 20 54 68 65 20 70 |bly code|. The p|
|00000b00| 72 6f 63 65 64 75 72 65 | 20 6f 75 74 6c 69 6e 65 |rocedure| outline|
|00000b10| 64 20 69 6e 20 50 61 73 | 63 61 6c 20 68 65 72 65 |d in Pas|cal here|
|00000b20| 20 69 73 0d 2a 20 66 6f | 6c 6c 6f 77 65 64 20 62 | is.* fo|llowed b|
|00000b30| 79 20 74 68 65 20 73 61 | 6d 65 20 6f 75 74 6c 69 |y the sa|me outli|
|00000b40| 6e 65 20 69 6e 20 61 73 | 73 65 6d 62 6c 79 2e 0d |ne in as|sembly..|
|00000b50| 0d 2a 20 50 52 4f 43 45 | 44 55 52 45 20 4d 79 50 |.* PROCE|DURE MyP|
|00000b60| 72 6f 63 65 64 75 72 65 | 20 28 50 61 72 61 6d 31 |rocedure| (Param1|
|00000b70| 3a 20 74 79 70 65 2c 20 | 50 61 72 61 6d 32 3a 20 |: type, |Param2: |
|00000b80| 74 79 70 65 2c 20 50 61 | 72 61 6d 4e 3a 20 74 79 |type, Pa|ramN: ty|
|00000b90| 70 65 29 20 52 65 73 75 | 6c 74 31 3a 20 74 79 70 |pe) Resu|lt1: typ|
|00000ba0| 65 3b 0d 0d 2a 20 56 41 | 52 09 4c 6f 63 61 6c 31 |e;..* VA|R.Local1|
|00000bb0| 3a 20 74 79 70 65 3b 0d | 2a 09 4c 6f 63 61 6c 32 |: type;.|*.Local2|
|00000bc0| 3a 20 74 79 70 65 3b 0d | 2a 09 4c 6f 63 61 6c 4e |: type;.|*.LocalN|
|00000bd0| 3a 20 74 79 70 65 3b 0d | 0d 0d 2a 20 4d 79 50 72 |: type;.|..* MyPr|
|00000be0| 6f 63 65 64 75 72 65 09 | 50 52 4f 43 09 45 58 50 |ocedure.|PROC.EXP|
|00000bf0| 4f 52 54 09 09 09 3b 20 | 61 6e 79 20 73 6f 75 72 |ORT...; |any sour|
|00000c00| 63 65 20 66 69 6c 65 20 | 63 61 6e 20 75 73 65 20 |ce file |can use |
|00000c10| 74 68 69 73 20 72 6f 75 | 74 69 6e 65 0d 0d 2a 20 |this rou|tine..* |
|00000c20| 64 65 66 69 6e 65 20 72 | 65 67 69 73 74 6f 72 73 |define r|egistors|
|00000c30| 20 74 68 61 74 20 6e 65 | 65 64 20 74 6f 20 62 65 | that ne|ed to be|
|00000c40| 20 73 61 76 65 64 20 61 | 73 20 45 51 55 41 54 45 | saved a|s EQUATE|
|00000c50| 53 20 28 74 79 70 69 63 | 61 6c 6c 79 20 41 33 2d |S (typic|ally A3-|
|00000c60| 41 37 20 61 6e 64 20 44 | 34 2d 44 37 29 0d 0d 2a |A7 and D|4-D7)..*|
|00000c70| 20 53 74 61 63 6b 46 72 | 61 6d 65 09 52 45 43 4f | StackFr|ame.RECO|
|00000c80| 52 44 09 7b 41 36 4c 69 | 6e 6b 7d 2c 44 45 43 52 |RD.{A6Li|nk},DECR|
|00000c90| 09 09 3b 20 62 75 69 6c | 64 20 61 20 73 74 61 63 |..; buil|d a stac|
|00000ca0| 6b 20 66 72 61 6d 65 20 | 72 65 63 6f 72 64 0d 2a |k frame |record.*|
|00000cb0| 20 52 65 73 75 6c 74 31 | 09 44 53 2e 7b 73 69 7a | Result1|.DS.{siz|
|00000cc0| 65 7d 09 09 09 3b 20 66 | 75 6e 63 74 69 6f 6e 27 |e}...; f|unction'|
|00000cd0| 73 20 72 65 73 75 6c 74 | 20 72 65 74 75 72 6e 65 |s result| returne|
|00000ce0| 64 20 74 6f 20 63 61 6c | 6c 65 72 0d 2a 20 50 61 |d to cal|ler.* Pa|
|00000cf0| 72 61 6d 42 65 67 69 6e | 09 45 51 55 09 2a 09 09 |ramBegin|.EQU.*..|
|00000d00| 09 3b 20 73 74 61 72 74 | 20 70 61 72 61 6d 65 74 |.; start| paramet|
|00000d10| 65 72 73 20 61 66 74 65 | 72 20 74 68 69 73 20 70 |ers afte|r this p|
|00000d20| 6f 69 6e 74 0d 2a 20 50 | 61 72 61 6d 31 09 44 53 |oint.* P|aram1.DS|
|00000d30| 2e 7b 73 69 7a 65 7d 09 | 09 09 3b 20 74 68 65 20 |.{size}.|..; the |
|00000d40| 66 69 72 73 74 20 70 61 | 72 61 6d 65 74 65 72 20 |first pa|rameter |
|00000d50| 6f 6e 20 74 68 65 20 73 | 74 61 63 6b 0d 2a 20 50 |on the s|tack.* P|
|00000d60| 61 72 61 6d 32 09 44 53 | 2e 7b 73 69 7a 65 7d 09 |aram2.DS|.{size}.|
|00000d70| 09 09 3b 20 72 65 73 74 | 20 6f 66 20 74 68 65 20 |..; rest| of the |
|00000d80| 70 61 72 61 6d 65 74 65 | 72 73 20 70 61 73 73 65 |paramete|rs passe|
|00000d90| 64 20 62 79 20 63 61 6c | 6c 65 72 0d 2a 20 50 61 |d by cal|ler.* Pa|
|00000da0| 72 61 6d 4e 09 44 53 2e | 7b 73 69 7a 65 7d 09 09 |ramN.DS.|{size}..|
|00000db0| 09 3b 20 74 68 65 20 6c | 61 73 74 20 70 61 72 61 |.; the l|ast para|
|00000dc0| 6d 65 74 65 72 20 70 61 | 73 73 65 64 20 62 79 20 |meter pa|ssed by |
|00000dd0| 63 61 6c 6c 65 72 0d 2a | 20 50 61 72 61 6d 53 69 |caller.*| ParamSi|
|00000de0| 7a 65 09 45 51 55 09 50 | 61 72 61 6d 42 65 67 69 |ze.EQU.P|aramBegi|
|00000df0| 6e 2d 2a 09 09 3b 20 73 | 69 7a 65 20 6f 66 20 61 |n-*..; s|ize of a|
|00000e00| 6c 6c 20 74 68 65 20 70 | 61 73 73 65 64 20 70 61 |ll the p|assed pa|
|00000e10| 72 61 6d 65 74 65 72 73 | 0d 2a 20 52 65 74 41 64 |rameters|.* RetAd|
|00000e20| 64 72 20 09 44 53 2e 4c | 09 31 09 09 09 3b 20 70 |dr .DS.L|.1...; p|
|00000e30| 6c 61 63 65 20 68 6f 6c | 64 65 72 20 66 6f 72 20 |lace hol|der for |
|00000e40| 72 65 74 75 72 6e 20 61 | 64 64 72 65 73 73 0d 2a |return a|ddress.*|
|00000e50| 20 41 36 4c 69 6e 6b 09 | 44 53 2e 4c 09 31 09 09 | A6Link.|DS.L.1..|
|00000e60| 09 3b 20 70 6c 61 63 65 | 20 68 6f 6c 64 65 72 20 |.; place| holder |
|00000e70| 66 6f 72 20 41 36 20 6c | 69 6e 6b 0d 2a 20 4c 6f |for A6 l|ink.* Lo|
|00000e80| 63 61 6c 31 09 44 53 2e | 7b 73 69 7a 65 7d 09 09 |cal1.DS.|{size}..|
|00000e90| 09 3b 20 61 20 6c 6f 63 | 61 6c 20 76 61 72 69 61 |.; a loc|al varia|
|00000ea0| 62 6c 65 20 66 6f 72 20 | 74 68 69 73 20 70 72 6f |ble for |this pro|
|00000eb0| 63 65 64 75 72 65 20 6f | 6e 6c 79 0d 2a 20 4c 6f |cedure o|nly.* Lo|
|00000ec0| 63 61 6c 32 09 44 53 2e | 7b 73 69 7a 65 7d 09 09 |cal2.DS.|{size}..|
|00000ed0| 09 3b 20 6f 74 68 65 72 | 20 6c 6f 63 61 6c 20 76 |.; other| local v|
|00000ee0| 61 72 69 61 62 6c 65 73 | 20 66 6f 72 20 74 68 69 |ariables| for thi|
|00000ef0| 73 20 70 72 6f 63 65 64 | 75 72 65 0d 2a 20 4c 6f |s proced|ure.* Lo|
|00000f00| 63 61 6c 4e 09 44 53 2e | 7b 73 69 7a 65 7d 09 09 |calN.DS.|{size}..|
|00000f10| 09 3b 20 74 68 65 20 6c | 61 73 74 20 6c 6f 63 61 |.; the l|ast loca|
|00000f20| 6c 20 76 61 72 69 61 62 | 6c 65 0d 2a 20 4c 6f 63 |l variab|le.* Loc|
|00000f30| 61 6c 53 69 7a 65 09 45 | 51 55 20 09 2a 09 09 09 |alSize.E|QU .*...|
|00000f40| 3b 20 73 69 7a 65 20 6f | 66 20 61 6c 6c 20 74 68 |; size o|f all th|
|00000f50| 65 20 6c 6f 63 61 6c 20 | 76 61 72 69 61 62 6c 65 |e local |variable|
|00000f60| 73 0d 2a 20 09 09 45 4e | 44 52 0d 0d 2a 20 09 09 |s.* ..EN|DR..* ..|
|00000f70| 57 49 54 48 09 53 74 61 | 63 6b 46 72 61 6d 65 09 |WITH.Sta|ckFrame.|
|00000f80| 09 3b 20 63 6f 76 65 72 | 20 6f 75 72 20 6c 6f 63 |.; cover| our loc|
|00000f90| 61 6c 20 73 74 61 63 6b | 20 66 72 61 6d 65 0d 2a |al stack| frame.*|
|00000fa0| 20 09 09 4c 49 4e 4b 09 | 41 36 2c 23 4c 6f 63 61 | ..LINK.|A6,#Loca|
|00000fb0| 6c 53 69 7a 65 09 09 3b | 20 61 6c 6c 6f 63 61 74 |lSize..;| allocat|
|00000fc0| 65 20 6f 75 72 20 6c 6f | 63 61 6c 20 73 74 61 63 |e our lo|cal stac|
|00000fd0| 6b 20 66 72 61 6d 65 0d | 0d 2a 09 09 73 61 76 65 |k frame.|.*..save|
|00000fe0| 20 72 65 67 69 73 74 6f | 72 73 20 74 72 61 73 68 | registo|rs trash|
|00000ff0| 65 64 20 62 79 20 74 68 | 69 73 20 72 6f 75 74 69 |ed by th|is routi|
|00001000| 6e 65 0d 0d 2a 20 09 09 | 23 20 23 20 49 4e 53 45 |ne..* ..|# # INSE|
|00001010| 52 54 20 59 4f 55 52 20 | 43 4f 44 45 20 48 45 52 |RT YOUR |CODE HER|
|00001020| 45 20 23 20 23 0d 0d 2a | 20 45 78 69 74 09 09 72 |E # #..*| Exit..r|
|00001030| 65 73 74 6f 72 65 20 72 | 65 67 69 73 74 6f 72 73 |estore r|egistors|
|00001040| 20 74 72 61 73 68 65 64 | 20 62 79 20 74 68 69 73 | trashed| by this|
|00001050| 20 72 6f 75 74 69 6e 65 | 0d 2a 20 09 09 55 4e 4c | routine|.* ..UNL|
|00001060| 4b 09 41 36 09 09 09 3b | 20 64 65 73 74 72 6f 79 |K.A6...;| destroy|
|00001070| 20 74 68 65 20 6c 69 6e | 6b 0d 2a 20 09 09 4d 4f | the lin|k.* ..MO|
|00001080| 56 45 41 2e 4c 09 28 53 | 50 29 2b 2c 41 30 09 09 |VEA.L.(S|P)+,A0..|
|00001090| 3b 20 70 75 6c 6c 20 6f | 66 66 20 74 68 65 20 72 |; pull o|ff the r|
|000010a0| 65 74 75 72 6e 20 61 64 | 64 72 65 73 73 0d 2a 20 |eturn ad|dress.* |
|000010b0| 09 09 41 44 44 41 2e 4c | 09 23 50 61 72 61 6d 53 |..ADDA.L|.#ParamS|
|000010c0| 69 7a 65 2c 53 50 09 09 | 3b 20 73 74 72 69 70 20 |ize,SP..|; strip |
|000010d0| 61 6c 6c 20 6f 66 20 74 | 68 65 20 63 61 6c 6c 65 |all of t|he calle|
|000010e0| 72 27 73 20 70 61 72 61 | 6d 65 74 65 72 73 0d 2a |r's para|meters.*|
|000010f0| 20 09 09 4a 4d 50 09 28 | 41 30 29 09 09 09 3b 20 | ..JMP.(|A0)...; |
|00001100| 72 65 74 75 72 6e 20 74 | 6f 20 74 68 65 20 63 61 |return t|o the ca|
|00001110| 6c 6c 65 72 0d 2a 20 09 | 09 44 62 67 49 6e 66 6f |ller.* .|.DbgInfo|
|00001120| 09 4d 79 50 72 6f 63 65 | 64 75 72 65 09 09 3b 20 |.MyProce|dure..; |
|00001130| 74 68 69 73 20 6e 61 6d | 65 20 77 69 6c 6c 20 61 |this nam|e will a|
|00001140| 70 70 65 61 72 20 69 6e | 20 74 68 65 20 64 65 62 |ppear in| the deb|
|00001150| 75 67 67 65 72 0d 2a 20 | 09 09 45 4e 44 50 0d 0d |ugger.* |..ENDP..|
|00001160| 2a 20 54 68 65 20 4d 61 | 63 72 6f 20 44 62 67 49 |* The Ma|cro DbgI|
|00001170| 6e 66 6f 20 69 73 20 6f | 70 74 69 6f 6e 61 6c 2e |nfo is o|ptional.|
|00001180| 20 20 49 20 70 72 65 66 | 65 72 20 74 6f 20 75 73 | I pref|er to us|
|00001190| 65 20 69 74 2c 20 73 69 | 6e 63 65 20 69 74 20 61 |e it, si|nce it a|
|000011a0| 69 64 73 20 69 6e 0d 2a | 20 64 65 62 75 67 67 69 |ids in.*| debuggi|
|000011b0| 6e 67 2e 20 20 54 68 65 | 72 65 20 61 72 65 20 6d |ng. The|re are m|
|000011c0| 6f 72 65 20 6d 61 63 72 | 6f 73 20 69 6e 20 74 68 |ore macr|os in th|
|000011d0| 65 20 22 41 53 74 72 75 | 63 74 4d 61 63 73 22 20 |e "AStru|ctMacs" |
|000011e0| 66 6f 6c 64 65 72 20 6f | 66 20 4d 50 57 2e 20 20 |folder o|f MPW. |
|000011f0| 50 75 74 20 6f 6e 0d 2a | 20 61 20 70 6f 74 20 6f |Put on.*| a pot o|
|00001200| 66 20 63 6f 66 66 65 65 | 20 61 6e 64 20 74 61 6b |f coffee| and tak|
|00001210| 65 20 61 20 6c 6f 6f 6b | 20 61 74 20 74 68 65 6d |e a look| at them|
|00001220| 20 61 6e 64 20 74 68 65 | 20 53 61 6d 70 6c 65 20 | and the| Sample |
|00001230| 70 72 6f 67 72 61 6d 20 | 74 68 61 74 20 75 73 65 |program |that use|
|00001240| 73 20 74 68 65 73 65 0d | 2a 20 6d 61 63 72 6f 73 |s these.|* macros|
|00001250| 2e 20 20 54 68 65 72 65 | 20 69 73 20 6f 6e 65 20 |. There| is one |
|00001260| 6d 61 63 72 6f 20 69 6e | 20 70 61 72 74 69 63 75 |macro in| particu|
|00001270| 6c 61 72 20 74 68 61 74 | 20 62 75 69 6c 64 73 20 |lar that| builds |
|00001280| 74 68 65 20 65 6e 74 69 | 72 65 20 73 74 61 63 6b |the enti|re stack|
|00001290| 20 66 72 61 6d 65 0d 2a | 20 73 74 72 75 63 74 75 | frame.*| structu|
|000012a0| 72 65 20 61 73 20 6f 75 | 74 6c 69 6e 65 64 20 61 |re as ou|tlined a|
|000012b0| 62 6f 76 65 2c 20 69 6e | 63 6c 75 64 69 6e 67 20 |bove, in|cluding |
|000012c0| 74 68 65 20 64 65 62 75 | 67 20 69 6e 66 6f 2e 0d |the debu|g info..|
|000012d0| 0d 2a 20 53 65 67 6d 65 | 6e 74 61 74 69 6f 6e 20 |.* Segme|ntation |
|000012e0| 73 74 72 61 74 65 67 79 | 3a 0d 2a 20 2d 2d 2d 2d |strategy|:.* ----|
|000012f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001300| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001310| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 0d 2a 20 54 68 |--------|---.* Th|
|00001320| 69 73 20 70 72 6f 67 72 | 61 6d 20 63 6f 6e 73 69 |is progr|am consi|
|00001330| 73 74 73 20 6f 66 20 74 | 68 72 65 65 20 73 65 67 |sts of t|hree seg|
|00001340| 6d 65 6e 74 73 2e 20 4d | 61 69 6e 20 63 6f 6e 74 |ments. M|ain cont|
|00001350| 61 69 6e 73 20 6d 6f 73 | 74 20 6f 66 20 74 68 65 |ains mos|t of the|
|00001360| 20 63 6f 64 65 2e 0d 2a | 20 49 6e 69 74 69 61 6c | code..*| Initial|
|00001370| 69 7a 65 20 63 6f 6e 74 | 61 69 6e 73 20 63 6f 64 |ize cont|ains cod|
|00001380| 65 20 74 68 61 74 20 69 | 73 20 6f 6e 6c 79 20 75 |e that i|s only u|
|00001390| 73 65 64 20 6f 6e 63 65 | 2c 20 64 75 72 69 6e 67 |sed once|, during|
|000013a0| 20 73 74 61 72 74 75 70 | 2c 20 61 6e 64 20 63 61 | startup|, and ca|
|000013b0| 6e 20 62 65 0d 2a 20 75 | 6e 6c 6f 61 64 65 64 20 |n be.* u|nloaded |
|000013c0| 61 66 74 65 72 20 74 68 | 65 20 70 72 6f 67 72 61 |after th|e progra|
|000013d0| 6d 20 73 74 61 72 74 73 | 2e 20 25 41 35 49 6e 69 |m starts|. %A5Ini|
|000013e0| 74 20 69 73 20 61 75 74 | 6f 6d 61 74 69 63 61 6c |t is aut|omatical|
|000013f0| 6c 79 20 63 72 65 61 74 | 65 64 20 62 79 20 74 68 |ly creat|ed by th|
|00001400| 65 0d 2a 20 4c 69 6e 6b | 65 72 20 74 6f 20 69 6e |e.* Link|er to in|
|00001410| 69 74 69 61 6c 69 7a 65 | 20 67 6c 6f 62 61 6c 73 |itialize| globals|
|00001420| 20 61 6e 64 20 63 6f 6e | 73 74 61 6e 74 73 2c 20 | and con|stants, |
|00001430| 61 6e 64 20 69 73 20 75 | 6e 6c 6f 61 64 65 64 20 |and is u|nloaded |
|00001440| 72 69 67 68 74 20 61 77 | 61 79 2e 0d 0d 2a 20 53 |right aw|ay...* S|
|00001450| 65 74 50 6f 72 74 20 73 | 74 72 61 74 65 67 79 3a |etPort s|trategy:|
|00001460| 0d 2a 20 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |.* -----|--------|
|00001470| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001480| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001490| 2d 2d 0d 2a 20 54 6f 6f | 6c 20 62 6f 78 20 72 6f |--.* Too|l box ro|
|000014a0| 75 74 69 6e 65 73 20 64 | 6f 20 6e 6f 74 20 63 68 |utines d|o not ch|
|000014b0| 61 6e 67 65 20 74 68 65 | 20 63 75 72 72 65 6e 74 |ange the| current|
|000014c0| 20 70 6f 72 74 2e 20 49 | 6e 20 73 70 69 74 65 20 | port. I|n spite |
|000014d0| 6f 66 20 74 68 69 73 2c | 20 69 6e 20 74 68 69 73 |of this,| in this|
|000014e0| 0d 2a 20 70 72 6f 67 72 | 61 6d 20 77 65 20 75 73 |.* progr|am we us|
|000014f0| 65 20 61 20 73 74 72 61 | 74 65 67 79 20 6f 66 20 |e a stra|tegy of |
|00001500| 63 61 6c 6c 69 6e 67 20 | 53 65 74 50 6f 72 74 20 |calling |SetPort |
|00001510| 77 68 65 6e 65 76 65 72 | 20 77 65 20 77 61 6e 74 |whenever| we want|
|00001520| 20 74 6f 20 64 72 61 77 | 20 6f 72 0d 2a 20 6d 61 | to draw| or.* ma|
|00001530| 6b 65 20 63 61 6c 6c 73 | 20 77 68 69 63 68 20 64 |ke calls| which d|
|00001540| 65 70 65 6e 64 20 6f 6e | 20 74 68 65 20 63 75 72 |epend on| the cur|
|00001550| 72 65 6e 74 20 70 6f 72 | 74 2e 20 54 68 69 73 20 |rent por|t. This |
|00001560| 6d 61 6b 65 73 20 75 73 | 20 6c 65 73 73 20 76 75 |makes us| less vu|
|00001570| 6c 6e 65 72 61 62 6c 65 | 0d 2a 20 74 6f 20 62 75 |lnerable|.* to bu|
|00001580| 67 73 20 69 6e 20 6f 74 | 68 65 72 20 73 6f 66 74 |gs in ot|her soft|
|00001590| 77 61 72 65 20 77 68 69 | 63 68 20 6d 69 67 68 74 |ware whi|ch might|
|000015a0| 20 61 6c 74 65 72 20 74 | 68 65 20 63 75 72 72 65 | alter t|he curre|
|000015b0| 6e 74 20 70 6f 72 74 20 | 28 73 75 63 68 20 61 73 |nt port |(such as|
|000015c0| 20 74 68 65 0d 2a 20 62 | 75 67 20 28 66 65 61 74 | the.* b|ug (feat|
|000015d0| 75 72 65 3f 29 20 69 6e | 20 6d 61 6e 79 20 64 65 |ure?) in| many de|
|000015e0| 73 6b 20 61 63 63 65 73 | 73 6f 72 69 65 73 20 77 |sk acces|sories w|
|000015f0| 68 69 63 68 20 63 68 61 | 6e 67 65 20 74 68 65 20 |hich cha|nge the |
|00001600| 70 6f 72 74 20 6f 6e 20 | 4f 70 65 6e 44 65 73 6b |port on |OpenDesk|
|00001610| 41 63 63 29 2e 0d 2a 20 | 48 6f 70 65 66 75 6c 6c |Acc)..* |Hopefull|
|00001620| 79 2c 20 74 68 69 73 20 | 61 6c 73 6f 20 6d 61 6b |y, this |also mak|
|00001630| 65 73 20 74 68 65 20 72 | 6f 75 74 69 6e 65 73 20 |es the r|outines |
|00001640| 66 72 6f 6d 20 74 68 69 | 73 20 70 72 6f 67 72 61 |from thi|s progra|
|00001650| 6d 20 6d 6f 72 65 20 73 | 65 6c 66 2d 63 6f 6e 74 |m more s|elf-cont|
|00001660| 61 69 6e 65 64 2c 0d 2a | 20 73 69 6e 63 65 20 74 |ained,.*| since t|
|00001670| 68 65 79 20 64 6f 6e 27 | 74 20 64 65 70 65 6e 64 |hey don'|t depend|
|00001680| 20 6f 6e 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 | on the |current |
|00001690| 70 6f 72 74 20 73 65 74 | 74 69 6e 67 2e 0d 0d 2a |port set|ting...*|
|000016a0| 20 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d | =======|========|
|000016b0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000016c0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000016d0| 3d 0d 2a 20 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |=.* ----|--------|
|000016e0| 2d 2d 20 49 4e 43 4c 55 | 44 45 53 20 53 45 43 54 |-- INCLU|DES SECT|
|000016f0| 49 4f 4e 20 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |ION ----|--------|
|00001700| 2d 2d 2d 2d 0d 2a 20 3d | 3d 3d 3d 3d 3d 3d 3d 3d |----.* =|========|
|00001710| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001720| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001730| 3d 3d 3d 3d 3d 3d 3d 0d | 09 0d 09 50 52 49 4e 54 |=======.|...PRINT|
|00001740| 09 50 55 53 48 2c 4f 46 | 46 09 09 09 3b 20 64 6f |.PUSH,OF|F...; do|
|00001750| 6e 27 74 20 70 72 69 6e | 74 20 61 6e 79 20 6f 66 |n't prin|t any of|
|00001760| 20 74 68 69 73 20 73 74 | 75 66 66 0d 0d 09 49 4e | this st|uff...IN|
|00001770| 43 4c 55 44 45 09 27 54 | 6f 6f 6c 45 71 75 2e 61 |CLUDE.'T|oolEqu.a|
|00001780| 27 0d 09 49 4e 43 4c 55 | 44 45 09 27 54 72 61 70 |'..INCLU|DE.'Trap|
|00001790| 73 2e 61 27 0d 09 49 4e | 43 4c 55 44 45 09 27 50 |s.a'..IN|CLUDE.'P|
|000017a0| 61 63 6b 4d 61 63 73 2e | 61 27 0d 09 49 4e 43 4c |ackMacs.|a'..INCL|
|000017b0| 55 44 45 09 27 51 75 69 | 63 6b 45 71 75 2e 61 27 |UDE.'Qui|ckEqu.a'|
|000017c0| 0d 09 49 4e 43 4c 55 44 | 45 09 27 53 79 73 45 71 |..INCLUD|E.'SysEq|
|000017d0| 75 2e 61 27 0d 09 49 4e | 43 4c 55 44 45 09 27 53 |u.a'..IN|CLUDE.'S|
|000017e0| 61 6d 70 6c 65 2e 69 6e | 63 31 2e 61 27 09 09 09 |ample.in|c1.a'...|
|000017f0| 3b 20 61 6c 6c 20 6f 75 | 72 20 6d 61 63 72 6f 73 |; all ou|r macros|
|00001800| 20 61 6e 64 20 64 61 74 | 61 20 74 65 6d 70 6c 61 | and dat|a templa|
|00001810| 74 65 73 0d 0d 09 50 52 | 49 4e 54 09 50 4f 50 09 |tes...PR|INT.POP.|
|00001820| 09 09 09 3b 20 72 65 73 | 74 6f 72 65 20 74 68 65 |...; res|tore the|
|00001830| 20 50 52 49 4e 54 20 6f | 70 74 69 6f 6e 73 0d 09 | PRINT o|ptions..|
|00001840| 0d 0d 2a 20 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |..* ====|========|
|00001850| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001860| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001870| 3d 3d 3d 3d 0d 2a 20 2d | 2d 2d 2d 2d 2d 2d 2d 2d |====.* -|--------|
|00001880| 20 20 44 41 54 41 20 53 | 54 4f 52 41 47 45 20 41 | DATA S|TORAGE A|
|00001890| 4c 4c 4f 43 41 54 49 4f | 4e 20 20 2d 2d 2d 2d 2d |LLOCATIO|N -----|
|000018a0| 2d 2d 2d 2d 2d 2d 2d 0d | 2a 20 3d 3d 3d 3d 3d 3d |-------.|* ======|
|000018b0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000018c0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000018d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 0d 2a 20 47 6c 6f |========|==.* Glo|
|000018e0| 62 61 6c 20 64 61 74 61 | 20 73 74 6f 72 61 67 65 |bal data| storage|
|000018f0| 2e 20 20 41 6c 6c 20 67 | 6c 6f 62 61 6c 20 6d 65 |. All g|lobal me|
|00001900| 6d 6f 72 79 20 69 73 20 | 61 6c 6c 6f 63 61 74 65 |mory is |allocate|
|00001910| 64 20 68 65 72 65 2e 20 | 20 54 68 65 0d 2a 20 4c |d here. | The.* L|
|00001920| 69 6e 6b 65 72 20 77 69 | 6c 6c 20 6c 6f 61 64 20 |inker wi|ll load |
|00001930| 61 6c 6c 20 67 6c 6f 62 | 61 6c 20 64 61 74 61 20 |all glob|al data |
|00001940| 6f 66 66 73 65 74 20 66 | 72 6f 6d 20 41 35 2c 20 |offset f|rom A5, |
|00001950| 61 6e 64 20 74 68 65 20 | 41 73 6d 20 6b 6e 6f 77 |and the |Asm know|
|00001960| 73 20 74 68 69 73 2e 0d | 2a 20 54 68 65 72 65 66 |s this..|* Theref|
|00001970| 6f 72 65 2c 20 6e 6f 20 | 72 65 66 65 72 65 6e 63 |ore, no |referenc|
|00001980| 65 20 74 6f 20 28 41 35 | 29 20 69 73 20 72 65 71 |e to (A5|) is req|
|00001990| 75 69 72 65 64 20 69 6e | 20 74 68 65 20 63 6f 64 |uired in| the cod|
|000019a0| 65 2e 20 48 6f 6f 72 61 | 79 21 0d 2a 20 48 65 72 |e. Hoora|y!.* Her|
|000019b0| 65 20 77 65 20 64 65 63 | 6c 61 72 65 20 74 77 6f |e we dec|lare two|
|000019c0| 20 64 61 74 61 20 73 74 | 72 75 63 74 75 72 65 73 | data st|ructures|
|000019d0| 20 75 73 69 6e 67 20 6f | 75 72 20 74 65 6d 70 6c | using o|ur templ|
|000019e0| 61 74 65 73 20 64 65 66 | 69 6e 65 64 20 70 72 65 |ates def|ined pre|
|000019f0| 76 69 6f 75 73 6c 79 2e | 0d 2a 20 54 68 65 79 20 |viously.|.* They |
|00001a00| 6d 75 73 74 20 62 65 20 | 45 58 50 4f 52 54 65 64 |must be |EXPORTed|
|00001a10| 20 68 65 72 65 20 66 6f | 72 20 6f 74 68 65 72 20 | here fo|r other |
|00001a20| 66 69 6c 65 73 20 74 68 | 61 74 20 6e 65 65 64 20 |files th|at need |
|00001a30| 74 6f 20 49 4d 50 4f 52 | 54 20 74 68 65 6d 2e 0d |to IMPOR|T them..|
|00001a40| 0d 09 09 45 58 50 4f 52 | 54 09 28 51 44 2c 47 29 |...EXPOR|T.(QD,G)|
|00001a50| 3a 44 41 54 41 0d 0d 51 | 44 09 09 44 53 09 51 44 |:DATA..Q|D..DS.QD|
|00001a60| 47 6c 6f 62 61 6c 73 09 | 09 3b 20 51 75 69 63 6b |Globals.|.; Quick|
|00001a70| 44 72 61 77 27 73 20 67 | 6c 6f 62 61 6c 73 0d 47 |Draw's g|lobals.G|
|00001a80| 09 09 44 53 09 41 70 70 | 47 6c 6f 62 61 6c 73 09 |..DS.App|Globals.|
|00001a90| 09 3b 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 27 73 |.; appli|cation's|
|00001aa0| 20 67 6c 6f 62 61 6c 73 | 0d 0d 0d 2a 20 3d 3d 3d | globals|...* ===|
|00001ab0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001ac0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001ad0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 0d 2a 20 |========|=====.* |
|00001ae0| 50 52 4f 43 45 44 55 52 | 45 20 49 6e 69 74 69 61 |PROCEDUR|E Initia|
|00001af0| 6c 69 7a 65 3b 0d 2a 20 | 3d 3d 3d 3d 3d 3d 3d 3d |lize;.* |========|
|00001b00| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001b10| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00001b20| 3d 3d 3d 3d 3d 3d 3d 3d | 0d 2a 20 53 65 74 20 75 |========|.* Set u|
|00001b30| 70 20 74 68 65 20 77 68 | 6f 6c 65 20 77 6f 72 6c |p the wh|ole worl|
|00001b40| 64 2c 20 69 6e 63 6c 75 | 64 69 6e 67 20 67 6c 6f |d, inclu|ding glo|
|00001b50| 62 61 6c 20 76 61 72 69 | 61 62 6c 65 73 2c 20 54 |bal vari|ables, T|
|00001b60| 6f 6f 6c 62 6f 78 20 6d | 61 6e 61 67 65 72 73 2c |oolbox m|anagers,|
|00001b70| 20 61 6e 64 20 6d 65 6e | 75 73 2e 0d 2a 20 43 68 | and men|us..* Ch|
|00001b80| 65 63 6b 20 74 6f 20 73 | 65 65 20 69 66 20 61 20 |eck to s|ee if a |
|00001b90| 67 69 76 65 6e 20 74 72 | 61 70 20 69 73 20 69 6d |given tr|ap is im|
|00001ba0| 70 6c 65 6d 65 6e 74 65 | 64 2e 20 54 68 65 20 72 |plemente|d. The r|
|00001bb0| 65 63 6f 6d 6d 65 6e 64 | 65 64 20 61 70 70 72 6f |ecommend|ed appro|
|00001bc0| 61 63 68 20 74 6f 20 73 | 65 65 20 69 66 0d 2a 20 |ach to s|ee if.* |
|00001bd0| 61 20 74 72 61 70 20 69 | 73 20 69 6d 70 6c 65 6d |a trap i|s implem|
|00001be0| 65 6e 74 65 64 20 69 73 | 20 74 6f 20 73 65 65 20 |ented is| to see |
|00001bf0| 69 66 20 74 68 65 20 61 | 64 64 72 65 73 73 20 6f |if the a|ddress o|
|00001c00| 66 20 74 68 65 20 74 72 | 61 70 20 72 6f 75 74 69 |f the tr|ap routi|
|00001c10| 6e 65 20 69 73 20 74 68 | 65 20 73 61 6d 65 0d 2a |ne is th|e same.*|
|00001c20| 20 61 73 20 74 68 65 20 | 61 64 64 72 65 73 73 20 | as the |address |
|00001c30| 6f 66 20 74 68 65 20 55 | 6e 69 6d 70 6c 65 6d 65 |of the U|nimpleme|
|00001c40| 6e 74 65 64 20 74 72 61 | 70 2e 20 20 57 65 20 61 |nted tra|p. We a|
|00001c50| 6c 73 6f 20 63 72 65 61 | 74 65 20 6f 75 72 20 6f |lso crea|te our o|
|00001c60| 6e 65 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 0d 2a |ne appli|cation.*|
|00001c70| 20 77 69 6e 64 6f 77 20 | 61 74 20 74 68 69 73 20 | window |at this |
|00001c80| 74 69 6d 65 2e 20 20 53 | 69 6e 63 65 20 77 69 6e |time. S|ince win|
|00001c90| 64 6f 77 20 73 74 6f 72 | 61 67 65 20 69 73 20 6e |dow stor|age is n|
|00001ca0| 6f 6e 2d 72 65 6c 6f 63 | 61 74 65 61 62 6c 65 2c |on-reloc|ateable,|
|00001cb0| 20 68 6f 77 20 61 6e 64 | 20 77 68 65 6e 20 74 6f | how and| when to|
|00001cc0| 0d 2a 20 61 6c 6c 6f 63 | 61 74 65 20 73 70 61 63 |.* alloc|ate spac|
|00001cd0| 65 20 66 6f 72 20 77 69 | 6e 64 6f 77 73 20 69 73 |e for wi|ndows is|
|00001ce0| 20 76 65 72 79 20 69 6d | 70 6f 72 74 61 6e 74 20 | very im|portant |
|00001cf0| 73 6f 20 74 68 61 74 20 | 68 65 61 70 20 66 72 61 |so that |heap fra|
|00001d00| 67 6d 65 6e 74 61 74 69 | 6f 6e 20 64 6f 65 73 20 |gmentati|on does |
|00001d10| 6e 6f 74 0d 2a 20 6f 63 | 63 75 72 2e 20 20 42 65 |not.* oc|cur. Be|
|00001d20| 63 61 75 73 65 20 53 61 | 6d 70 6c 65 20 68 61 73 |cause Sa|mple has|
|00001d30| 20 6f 6e 6c 79 20 6f 6e | 65 20 77 69 6e 64 6f 77 | only on|e window|
|00001d40| 20 61 6e 64 20 69 74 20 | 69 73 20 6f 6e 6c 79 20 | and it |is only |
|00001d50| 64 69 73 70 6f 73 65 64 | 20 77 68 65 6e 20 74 68 |disposed| when th|
|00001d60| 65 0d 2a 20 61 70 70 6c | 69 63 61 74 69 6f 6e 20 |e.* appl|ication |
|00001d70| 71 75 69 74 73 2c 20 77 | 65 20 77 69 6c 6c 20 61 |quits, w|e will a|
|00001d80| 6c 6c 6f 63 61 74 65 20 | 69 74 73 20 73 70 61 63 |llocate |its spac|
|00001d90| 65 20 68 65 72 65 2c 20 | 62 65 66 6f 72 65 20 61 |e here, |before a|
|00001da0| 6e 79 74 68 69 6e 67 20 | 74 68 61 74 20 6d 69 67 |nything |that mig|
|00001db0| 68 74 0d 2a 20 62 65 20 | 61 20 6c 6f 63 6b 65 64 |ht.* be |a locked|
|00001dc0| 20 72 65 6c 6f 63 61 74 | 61 62 6c 65 20 6f 62 6a | relocat|able obj|
|00001dd0| 65 63 74 20 67 65 74 73 | 20 69 6e 74 6f 20 74 68 |ect gets| into th|
|00001de0| 65 20 68 65 61 70 2e 20 | 54 68 69 73 20 77 61 79 |e heap. |This way|
|00001df0| 2c 20 77 65 20 63 61 6e | 20 66 6f 72 63 65 20 69 |, we can| force i|
|00001e00| 74 73 0d 2a 20 73 74 6f | 72 61 67 65 20 74 6f 20 |ts.* sto|rage to |
|00001e10| 62 65 20 69 6e 20 74 68 | 65 20 6c 6f 77 65 73 74 |be in th|e lowest|
|00001e20| 20 6d 65 6d 6f 72 79 20 | 61 76 61 69 6c 61 62 6c | memory |availabl|
|00001e30| 65 20 69 6e 20 74 68 65 | 20 68 65 61 70 2e 20 57 |e in the| heap. W|
|00001e40| 69 6e 64 6f 77 20 73 74 | 6f 72 61 67 65 20 63 61 |indow st|orage ca|
|00001e50| 6e 0d 2a 20 64 69 66 66 | 65 72 20 77 69 64 65 6c |n.* diff|er widel|
|00001e60| 79 20 61 6d 6f 6e 67 73 | 74 20 61 70 70 6c 69 63 |y amongs|t applic|
|00001e70| 61 74 69 6f 6e 73 20 64 | 65 70 65 6e 64 69 6e 67 |ations d|epending|
|00001e80| 20 6f 6e 20 68 6f 77 20 | 6d 61 6e 79 20 77 69 6e | on how |many win|
|00001e90| 64 6f 77 73 20 61 72 65 | 20 63 72 65 61 74 65 64 |dows are| created|
|00001ea0| 0d 2a 20 61 6e 64 20 64 | 69 73 70 6f 73 65 64 2e |.* and d|isposed.|
|00001eb0| 20 20 49 66 20 61 20 66 | 61 69 6c 75 72 65 20 6f | If a f|ailure o|
|00001ec0| 63 63 75 72 73 20 68 65 | 72 65 2c 20 77 65 20 77 |ccurs he|re, we w|
|00001ed0| 69 6c 6c 20 63 6f 6e 73 | 69 64 65 72 20 74 68 61 |ill cons|ider tha|
|00001ee0| 74 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f |t the ap|plicatio|
|00001ef0| 6e 0d 2a 20 69 73 20 69 | 6e 20 73 75 63 68 20 62 |n.* is i|n such b|
|00001f00| 61 64 20 73 68 61 70 65 | 20 74 68 61 74 20 77 65 |ad shape| that we|
|00001f10| 20 73 68 6f 75 6c 64 20 | 6a 75 73 74 20 65 78 69 | should |just exi|
|00001f20| 74 2e 20 59 6f 75 72 20 | 65 72 72 6f 72 20 68 61 |t. Your |error ha|
|00001f30| 6e 64 6c 69 6e 67 20 6d | 61 79 20 64 69 66 66 65 |ndling m|ay diffe|
|00001f40| 72 2c 0d 2a 20 62 75 74 | 20 74 68 65 20 63 68 65 |r,.* but| the che|
|00001f50| 63 6b 73 20 73 68 6f 75 | 6c 64 20 73 74 69 6c 6c |cks shou|ld still|
|00001f60| 20 62 65 20 6d 61 64 65 | 2e 0d 0d 2a 20 49 66 20 | be made|...* If |
|00001f70| 61 6e 20 65 72 72 6f 72 | 20 69 73 20 64 65 74 65 |an error| is dete|
|00001f80| 63 74 65 64 2c 20 69 6e | 73 74 65 61 64 20 6f 66 |cted, in|stead of|
|00001f90| 20 6d 65 72 65 6c 79 20 | 64 6f 69 6e 67 20 61 6e | merely |doing an|
|00001fa0| 20 45 78 69 74 54 6f 53 | 68 65 6c 6c 2c 20 77 68 | ExitToS|hell, wh|
|00001fb0| 69 63 68 20 6c 65 61 76 | 65 73 0d 2a 20 74 68 65 |ich leav|es.* the|
|00001fc0| 20 75 73 65 72 20 77 69 | 74 68 6f 75 74 20 6d 75 | user wi|thout mu|
|00001fd0| 63 68 20 74 6f 20 67 6f | 20 6f 6e 2c 20 77 65 20 |ch to go| on, we |
|00001fe0| 63 61 6c 6c 20 41 6c 65 | 72 74 55 73 65 72 2c 20 |call Ale|rtUser, |
|00001ff0| 77 68 69 63 68 20 70 75 | 74 73 20 75 70 20 61 20 |which pu|ts up a |
|00002000| 73 69 6d 70 6c 65 20 61 | 6c 65 72 74 0d 2a 20 74 |simple a|lert.* t|
|00002010| 68 61 74 20 6a 75 73 74 | 20 73 61 79 73 20 61 6e |hat just| says an|
|00002020| 20 65 72 72 6f 72 20 6f | 63 63 75 72 72 65 64 20 | error o|ccurred |
|00002030| 61 6e 64 20 74 68 65 6e | 20 63 61 6c 6c 73 20 45 |and then| calls E|
|00002040| 78 69 74 54 6f 53 68 65 | 6c 6c 2e 20 20 49 6e 20 |xitToShe|ll. In |
|00002050| 74 68 65 20 69 6e 74 65 | 72 65 73 74 73 0d 2a 20 |the inte|rests.* |
|00002060| 6f 66 20 6b 65 65 70 69 | 6e 67 20 74 68 69 6e 67 |of keepi|ng thing|
|00002070| 73 20 73 69 6d 70 6c 65 | 2c 20 74 68 65 20 61 6c |s simple|, the al|
|00002080| 65 72 74 20 64 6f 65 73 | 20 6e 6f 74 20 73 74 61 |ert does| not sta|
|00002090| 74 65 20 74 68 65 20 73 | 70 65 63 69 66 69 63 20 |te the s|pecific |
|000020a0| 63 61 75 73 65 20 6f 66 | 20 74 68 65 20 65 72 72 |cause of| the err|
|000020b0| 6f 72 2c 0d 2a 20 62 75 | 74 20 61 20 6d 6f 72 65 |or,.* bu|t a more|
|000020c0| 20 69 6e 66 6f 72 6d 61 | 74 69 76 65 20 61 6c 65 | informa|tive ale|
|000020d0| 72 74 20 77 6f 75 6c 64 | 20 62 65 20 61 70 70 72 |rt would| be appr|
|000020e0| 6f 70 72 69 61 74 65 20 | 66 6f 72 20 6d 6f 72 65 |opriate |for more|
|000020f0| 20 73 6f 70 68 69 73 74 | 69 63 61 74 65 64 20 61 | sophist|icated a|
|00002100| 70 70 6c 69 63 61 74 69 | 6f 6e 73 2e 0d 2a 20 53 |pplicati|ons..* S|
|00002110| 69 6e 63 65 20 74 68 65 | 72 65 20 69 73 20 6e 6f |ince the|re is no|
|00002120| 20 6f 74 68 65 72 20 63 | 6c 65 61 6e 75 70 20 6e | other c|leanup n|
|00002130| 65 65 64 65 64 20 61 74 | 20 74 68 69 73 20 70 6f |eeded at| this po|
|00002140| 69 6e 74 20 69 66 20 61 | 6e 20 65 72 72 6f 72 20 |int if a|n error |
|00002150| 69 73 20 64 65 74 65 63 | 74 65 64 2c 20 74 68 69 |is detec|ted, thi|
|00002160| 73 0d 2a 20 66 6f 72 6d | 20 6f 66 20 65 72 72 6f |s.* form| of erro|
|00002170| 72 2d 20 68 61 6e 64 6c | 69 6e 67 20 69 73 20 61 |r- handl|ing is a|
|00002180| 63 63 65 70 74 61 62 6c | 65 2e 20 49 66 20 6d 6f |cceptabl|e. If mo|
|00002190| 72 65 20 73 6f 70 68 69 | 73 74 69 63 61 74 65 64 |re sophi|sticated|
|000021a0| 20 65 72 72 6f 72 20 72 | 65 63 6f 76 65 72 79 20 | error r|ecovery |
|000021b0| 69 73 20 6e 65 65 64 65 | 64 2c 0d 2a 20 61 20 73 |is neede|d,.* a s|
|000021c0| 69 67 6e 61 6c 20 6d 65 | 63 68 61 6e 69 73 6d 2c |ignal me|chanism,|
|000021d0| 20 73 75 63 68 20 61 73 | 20 69 73 20 70 72 6f 76 | such as| is prov|
|000021e0| 69 64 65 64 20 62 79 20 | 53 69 67 6e 61 6c 73 2c |ided by |Signals,|
|000021f0| 20 63 61 6e 20 62 65 20 | 75 73 65 64 2e 0d 0d 2a | can be |used...*|
|00002200| 20 53 6f 6d 65 74 68 69 | 6e 67 20 77 6f 72 74 68 | Somethi|ng worth|
|00002210| 20 6e 6f 74 69 6e 67 20 | 68 65 72 65 2e 20 20 53 | noting |here. S|
|00002220| 69 6e 63 65 20 74 68 65 | 20 41 6c 65 72 74 55 73 |ince the| AlertUs|
|00002230| 65 72 20 72 6f 75 74 69 | 6e 65 20 69 73 20 69 6e |er routi|ne is in|
|00002240| 20 61 20 64 69 66 66 65 | 72 65 6e 74 20 73 65 67 | a diffe|rent seg|
|00002250| 6d 65 6e 74 2c 0d 2a 20 | 77 65 20 68 61 76 65 20 |ment,.* |we have |
|00002260| 74 6f 20 75 73 65 20 61 | 20 4a 75 6d 70 20 69 6e |to use a| Jump in|
|00002270| 73 74 72 75 63 74 69 6f | 6e 20 74 6f 20 67 65 74 |structio|n to get|
|00002280| 20 74 68 65 72 65 2e 20 | 20 49 6e 20 6f 74 68 65 | there. | In othe|
|00002290| 72 20 77 6f 72 64 73 2c | 20 77 65 20 6d 75 73 74 |r words,| we must|
|000022a0| 20 67 6f 20 74 68 72 6f | 75 67 68 20 74 68 65 0d | go thro|ugh the.|
|000022b0| 2a 20 6a 75 6d 70 20 74 | 61 62 6c 65 2e 20 20 54 |* jump t|able. T|
|000022c0| 68 69 73 20 63 61 75 73 | 65 73 20 65 78 74 72 61 |his caus|es extra|
|000022d0| 20 74 65 73 74 20 61 6e | 64 20 62 72 61 6e 63 68 | test an|d branch|
|000022e0| 20 69 6e 73 74 72 75 63 | 74 69 6f 6e 73 20 74 6f | instruc|tions to|
|000022f0| 20 67 65 74 20 6f 76 65 | 72 20 74 68 65 20 4a 4d | get ove|r the JM|
|00002300| 50 20 41 6c 65 72 74 55 | 73 65 72 2e 0d 0d 09 09 |P AlertU|ser.....|
|00002310| 53 45 47 20 27 49 6e 69 | 74 69 61 6c 69 7a 65 27 |SEG 'Ini|tialize'|
|00002320| 09 09 3b 20 63 61 73 65 | 20 73 65 6e 73 69 74 69 |..; case| sensiti|
|00002330| 76 65 0d 49 6e 69 74 69 | 61 6c 69 7a 65 09 50 52 |ve.Initi|alize.PR|
|00002340| 4f 43 09 09 09 09 3b 20 | 49 6e 69 74 69 61 6c 69 |OC....; |Initiali|
|00002350| 7a 65 20 65 76 65 72 79 | 74 68 69 6e 67 0d 0d 43 |ze every|thing..C|
|00002360| 6f 75 6e 74 52 65 67 09 | 45 51 55 09 44 34 09 09 |ountReg.|EQU.D4..|
|00002370| 09 3b 20 74 65 6d 70 6f | 72 61 72 79 20 72 65 67 |.; tempo|rary reg|
|00002380| 69 73 74 6f 72 20 74 6f | 20 63 6f 75 6e 74 20 6c |istor to| count l|
|00002390| 6f 6f 70 73 0d 0d 53 74 | 61 63 6b 46 72 61 6d 65 |oops..St|ackFrame|
|000023a0| 09 52 45 43 4f 52 44 09 | 7b 41 36 4c 69 6e 6b 7d |.RECORD.|{A6Link}|
|000023b0| 2c 44 45 43 52 09 09 3b | 20 62 75 69 6c 64 20 61 |,DECR..;| build a|
|000023c0| 20 73 74 61 63 6b 20 66 | 72 61 6d 65 20 72 65 63 | stack f|rame rec|
|000023d0| 6f 72 64 0d 50 61 72 61 | 6d 42 65 67 69 6e 09 45 |ord.Para|mBegin.E|
|000023e0| 51 55 09 2a 09 09 09 3b | 20 73 74 61 72 74 20 70 |QU.*...;| start p|
|000023f0| 61 72 61 6d 65 74 65 72 | 73 20 61 66 74 65 72 20 |arameter|s after |
|00002400| 74 68 69 73 20 70 6f 69 | 6e 74 0d 50 61 72 61 6d |this poi|nt.Param|
|00002410| 53 69 7a 65 09 45 51 55 | 09 50 61 72 61 6d 42 65 |Size.EQU|.ParamBe|
|00002420| 67 69 6e 2d 2a 09 09 3b | 20 73 69 7a 65 20 6f 66 |gin-*..;| size of|
|00002430| 20 61 6c 6c 20 74 68 65 | 20 70 61 73 73 65 64 20 | all the| passed |
|00002440| 70 61 72 61 6d 65 74 65 | 72 73 0d 52 65 74 41 64 |paramete|rs.RetAd|
|00002450| 64 72 20 09 44 53 2e 4c | 09 31 09 09 09 3b 20 70 |dr .DS.L|.1...; p|
|00002460| 6c 61 63 65 20 68 6f 6c | 64 65 72 20 66 6f 72 20 |lace hol|der for |
|00002470| 72 65 74 75 72 6e 20 61 | 64 64 72 65 73 73 0d 41 |return a|ddress.A|
|00002480| 36 4c 69 6e 6b 09 09 44 | 53 2e 4c 09 31 09 09 09 |6Link..D|S.L.1...|
|00002490| 3b 20 70 6c 61 63 65 20 | 68 6f 6c 64 65 72 20 66 |; place |holder f|
|000024a0| 6f 72 20 41 36 20 6c 69 | 6e 6b 0d 43 75 72 4d 42 |or A6 li|nk.CurMB|
|000024b0| 61 72 09 09 44 53 2e 4c | 09 31 09 09 09 3b 20 6c |ar..DS.L|.1...; l|
|000024c0| 6f 63 61 6c 20 68 61 6e | 64 6c 65 20 74 6f 20 6f |ocal han|dle to o|
|000024d0| 75 72 20 6d 65 6e 75 62 | 61 72 0d 54 68 65 45 76 |ur menub|ar.TheEv|
|000024e0| 65 6e 74 20 09 44 53 09 | 45 76 65 6e 74 52 65 63 |ent .DS.|EventRec|
|000024f0| 6f 72 64 20 09 09 3b 20 | 6c 6f 63 61 6c 20 63 6f |ord ..; |local co|
|00002500| 70 79 20 6f 66 20 74 68 | 65 20 65 76 65 6e 74 20 |py of th|e event |
|00002510| 72 65 63 6f 72 64 0d 4c | 6f 63 61 6c 53 69 7a 65 |record.L|ocalSize|
|00002520| 09 45 51 55 20 09 2a 09 | 09 09 3b 20 73 69 7a 65 |.EQU .*.|..; size|
|00002530| 20 6f 66 20 61 6c 6c 20 | 74 68 65 20 6c 6f 63 61 | of all |the loca|
|00002540| 6c 20 76 61 72 69 61 62 | 6c 65 73 0d 09 09 45 4e |l variab|les...EN|
|00002550| 44 52 0d 09 09 0d 09 09 | 49 4d 50 4f 52 54 09 47 |DR......|IMPORT.G|
|00002560| 6f 47 65 74 52 65 63 74 | 2c 41 6c 65 72 74 55 73 |oGetRect|,AlertUs|
|00002570| 65 72 2c 53 79 73 45 6e | 76 69 72 6f 6e 73 2c 09 |er,SysEn|virons,.|
|00002580| 5c 0d 09 09 09 54 72 61 | 70 41 76 61 69 6c 61 62 |\....Tra|pAvailab|
|00002590| 6c 65 09 09 3b 20 6c 69 | 6e 6b 65 64 20 69 6e 20 |le..; li|nked in |
|000025a0| 77 69 74 68 20 49 6e 74 | 65 72 66 61 63 65 2e 6f |with Int|erface.o|
|000025b0| 0d 0d 09 09 57 49 54 48 | 09 53 74 61 63 6b 46 72 |....WITH|.StackFr|
|000025c0| 61 6d 65 09 09 3b 20 63 | 6f 76 65 72 20 6f 75 72 |ame..; c|over our|
|000025d0| 20 6c 6f 63 61 6c 20 73 | 74 61 63 6b 20 66 72 61 | local s|tack fra|
|000025e0| 6d 65 0d 09 09 4c 49 4e | 4b 09 41 36 2c 23 4c 6f |me...LIN|K.A6,#Lo|
|000025f0| 63 61 6c 53 69 7a 65 09 | 09 3b 20 61 6c 6c 6f 63 |calSize.|.; alloc|
|00002600| 61 74 65 20 6f 75 72 20 | 6c 6f 63 61 6c 20 73 74 |ate our |local st|
|00002610| 61 63 6b 20 66 72 61 6d | 65 0d 09 09 0d 09 09 4d |ack fram|e......M|
|00002620| 4f 56 45 4d 2e 4c 09 43 | 6f 75 6e 74 52 65 67 2c |OVEM.L.C|ountReg,|
|00002630| 2d 28 53 50 29 20 09 09 | 3b 20 73 61 76 65 20 74 |-(SP) ..|; save t|
|00002640| 68 65 20 63 75 72 72 65 | 6e 74 20 72 65 67 69 73 |he curre|nt regis|
|00002650| 74 6f 72 20 76 61 6c 75 | 65 73 0d 09 09 4d 4f 56 |tor valu|es...MOV|
|00002660| 45 2e 57 09 23 46 61 6c | 73 65 2c 47 2e 49 6e 42 |E.W.#Fal|se,G.InB|
|00002670| 61 63 6b 67 72 6f 75 6e | 64 09 3b 20 77 65 20 73 |ackgroun|d.; we s|
|00002680| 74 61 72 74 20 6f 75 74 | 20 69 6e 20 74 68 65 20 |tart out| in the |
|00002690| 66 6f 72 65 67 72 6f 75 | 6e 64 0d 09 09 4d 4f 56 |foregrou|nd...MOV|
|000026a0| 45 2e 57 09 23 54 72 75 | 65 2c 47 2e 53 74 6f 70 |E.W.#Tru|e,G.Stop|
|000026b0| 70 65 64 09 09 3b 20 77 | 65 27 6c 6c 20 73 74 61 |ped..; w|e'll sta|
|000026c0| 72 74 20 77 69 74 68 20 | 74 68 65 20 72 65 64 20 |rt with |the red |
|000026d0| 6c 69 67 68 74 20 6f 6e | 0d 0d 2a 20 2d 2d 2d 2d |light on|..* ----|
|000026e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 20 49 4e 49 54 49 41 |--------|- INITIA|
|000026f0| 4c 49 5a 45 20 4d 41 4e | 41 47 45 52 53 20 2d 2d |LIZE MAN|AGERS --|
|00002700| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 0d 0d 40 31 09 |--------|---..@1.|
|00002710| 09 50 45 41 20 09 51 44 | 2e 47 72 61 66 50 6f 72 |.PEA .QD|.GrafPor|
|00002720| 74 20 09 09 3b 20 69 6e | 69 74 69 61 6c 69 7a 65 |t ..; in|itialize|
|00002730| 20 61 6c 6c 20 6f 66 20 | 74 68 65 20 4d 61 6e 61 | all of |the Mana|
|00002740| 67 65 72 73 0d 09 09 5f | 49 6e 69 74 47 72 61 66 |gers..._|InitGraf|
|00002750| 09 09 09 3b 20 70 6c 65 | 61 73 65 20 64 6f 6e 27 |...; ple|ase don'|
|00002760| 74 20 66 6c 75 73 68 20 | 6d 79 20 65 76 65 6e 74 |t flush |my event|
|00002770| 73 0d 09 09 5f 49 6e 69 | 74 46 6f 6e 74 73 0d 09 |s..._Ini|tFonts..|
|00002780| 09 5f 49 6e 69 74 57 69 | 6e 64 6f 77 73 0d 09 09 |._InitWi|ndows...|
|00002790| 5f 49 6e 69 74 4d 65 6e | 75 73 0d 09 09 5f 54 45 |_InitMen|us..._TE|
|000027a0| 49 6e 69 74 0d 09 09 43 | 4c 52 2e 4c 09 2d 28 53 |Init...C|LR.L.-(S|
|000027b0| 50 29 09 0d 09 09 5f 49 | 6e 69 74 44 69 61 6c 6f |P)...._I|nitDialo|
|000027c0| 67 73 0d 09 09 5f 49 6e | 69 74 43 75 72 73 6f 72 |gs..._In|itCursor|
|000027d0| 0d 09 09 0d 2a 20 43 61 | 6c 6c 20 4d 50 50 4f 70 |....* Ca|ll MPPOp|
|000027e0| 65 6e 20 61 6e 64 20 41 | 54 50 4c 6f 61 64 20 61 |en and A|TPLoad a|
|000027f0| 74 20 74 68 69 73 20 70 | 6f 69 6e 74 20 74 6f 20 |t this p|oint to |
|00002800| 69 6e 69 74 69 61 6c 69 | 7a 65 20 41 70 70 6c 65 |initiali|ze Apple|
|00002810| 54 61 6c 6b 2c 20 69 66 | 20 79 6f 75 20 61 72 65 |Talk, if| you are|
|00002820| 20 75 73 69 6e 67 20 69 | 74 2e 0d 2a 20 4e 4f 54 | using i|t..* NOT|
|00002830| 45 20 2d 2d 20 49 74 20 | 69 73 20 6e 6f 20 6c 6f |E -- It |is no lo|
|00002840| 6e 67 65 72 20 6e 65 63 | 65 73 73 61 72 79 2c 20 |nger nec|essary, |
|00002850| 61 6e 64 20 61 63 74 75 | 61 6c 6c 79 20 75 6e 68 |and actu|ally unh|
|00002860| 65 61 6c 74 68 79 2c 20 | 74 6f 20 63 68 65 63 6b |ealthy, |to check|
|00002870| 20 50 6f 72 74 42 55 73 | 65 20 61 6e 64 0d 2a 20 | PortBUs|e and.* |
|00002880| 53 50 43 6f 6e 66 69 67 | 20 62 65 66 6f 72 65 20 |SPConfig| before |
|00002890| 6f 70 65 6e 69 6e 67 20 | 41 70 70 6c 65 54 61 6c |opening |AppleTal|
|000028a0| 6b 2e 20 54 68 65 20 64 | 72 69 76 65 72 73 20 61 |k. The d|rivers a|
|000028b0| 72 65 20 63 61 70 61 62 | 6c 65 20 6f 66 20 63 68 |re capab|le of ch|
|000028c0| 65 63 6b 69 6e 67 20 66 | 6f 72 20 70 6f 72 74 0d |ecking f|or port.|
|000028d0| 2a 20 61 76 61 69 6c 61 | 62 69 6c 69 74 79 20 74 |* availa|bility t|
|000028e0| 68 65 6d 73 65 6c 76 65 | 73 2e 20 20 54 68 69 73 |hemselve|s. This|
|000028f0| 20 6e 65 78 74 20 62 69 | 74 20 6f 66 20 63 6f 64 | next bi|t of cod|
|00002900| 65 20 69 73 20 6e 65 63 | 65 73 73 61 72 79 20 74 |e is nec|essary t|
|00002910| 6f 20 61 6c 6c 6f 77 20 | 74 68 65 20 64 65 66 61 |o allow |the defa|
|00002920| 75 6c 74 0d 2a 20 62 75 | 74 74 6f 6e 20 6f 66 20 |ult.* bu|tton of |
|00002930| 6f 75 72 20 61 6c 65 72 | 74 20 62 65 20 6f 75 74 |our aler|t be out|
|00002940| 6c 69 6e 65 64 2e 0d 09 | 20 0d 2a 20 2d 2d 2d 2d |lined...| .* ----|
|00002950| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 20 57 41 53 54 45 20 |--------|- WASTE |
|00002960| 54 48 52 45 45 20 45 56 | 45 4e 54 53 20 2d 2d 2d |THREE EV|ENTS ---|
|00002970| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 0d 0d 09 09 4d 4f |--------|--....MO|
|00002980| 56 45 2e 57 09 23 32 2c | 43 6f 75 6e 74 52 65 67 |VE.W.#2,|CountReg|
|00002990| 09 09 3b 20 73 65 74 20 | 72 65 67 69 73 74 65 72 |..; set |register|
|000029a0| 20 76 61 6c 75 65 20 74 | 6f 20 6c 6f 6f 70 20 33 | value t|o loop 3|
|000029b0| 20 74 69 6d 65 73 0d 4c | 6f 6f 70 09 09 43 4c 52 | times.L|oop..CLR|
|000029c0| 2e 57 09 2d 28 53 50 29 | 09 09 09 3b 20 73 70 61 |.W.-(SP)|...; spa|
|000029d0| 63 65 20 66 6f 72 20 72 | 65 73 75 6c 74 0d 09 09 |ce for r|esult...|
|000029e0| 4d 4f 56 45 2e 57 09 23 | 45 76 65 72 79 45 76 65 |MOVE.W.#|EveryEve|
|000029f0| 6e 74 2c 2d 28 53 50 29 | 09 3b 20 74 68 65 20 65 |nt,-(SP)|.; the e|
|00002a00| 76 65 6e 74 73 20 77 65 | 20 77 61 6e 74 0d 09 09 |vents we| want...|
|00002a10| 50 45 41 09 54 68 65 45 | 76 65 6e 74 28 41 36 29 |PEA.TheE|vent(A6)|
|00002a20| 09 09 3b 20 70 61 73 73 | 20 61 20 70 6f 69 6e 74 |..; pass| a point|
|00002a30| 65 72 20 74 6f 20 6f 75 | 72 20 65 76 65 6e 74 0d |er to ou|r event.|
|00002a40| 09 09 5f 45 76 65 6e 74 | 41 76 61 69 6c 0d 09 09 |.._Event|Avail...|
|00002a50| 4d 4f 56 45 2e 57 09 28 | 53 50 29 2b 2c 44 30 09 |MOVE.W.(|SP)+,D0.|
|00002a60| 09 3b 20 72 65 73 75 6c | 74 20 63 6f 64 65 0d 09 |.; resul|t code..|
|00002a70| 09 44 42 46 09 43 6f 75 | 6e 74 52 65 67 2c 4c 6f |.DBF.Cou|ntReg,Lo|
|00002a80| 6f 70 09 09 3b 20 64 65 | 63 72 65 6d 65 6e 74 20 |op..; de|crement |
|00002a90| 63 6f 75 6e 74 2c 20 69 | 66 20 63 6f 75 6e 74 20 |count, i|f count |
|00002aa0| 3c 20 30 20 74 68 65 6e | 20 63 6f 6e 74 69 6e 75 |< 0 then| continu|
|00002ab0| 65 0d 0d 2a 20 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |e..* ---|--------|
|00002ac0| 2d 2d 20 47 45 54 20 54 | 48 45 20 45 4e 56 49 52 |-- GET T|HE ENVIR|
|00002ad0| 4f 4e 4d 45 4e 54 20 2d | 2d 2d 2d 2d 2d 2d 2d 2d |ONMENT -|--------|
|00002ae0| 2d 2d 2d 2d 0d 0d 09 09 | 43 4c 52 2e 57 09 2d 28 |----....|CLR.W.-(|
|00002af0| 53 50 29 09 09 09 3b 20 | 63 72 65 61 74 65 20 73 |SP)...; |create s|
|00002b00| 70 61 63 65 20 66 6f 72 | 20 72 65 73 75 6c 74 0d |pace for| result.|
|00002b10| 09 09 4d 4f 56 45 2e 57 | 09 23 45 6e 76 69 72 6f |..MOVE.W|.#Enviro|
|00002b20| 6e 73 56 65 72 73 69 6f | 6e 2c 2d 28 53 50 29 09 |nsVersio|n,-(SP).|
|00002b30| 3b 20 76 65 72 73 69 6f | 6e 20 6f 66 20 53 79 73 |; versio|n of Sys|
|00002b40| 45 6e 76 69 72 6f 6e 73 | 20 77 65 20 77 61 6e 74 |Environs| we want|
|00002b50| 0d 09 09 50 45 41 09 47 | 2e 4d 61 63 09 09 09 3b |...PEA.G|.Mac...;|
|00002b60| 20 74 68 65 20 67 6c 6f | 62 61 6c 20 65 6e 76 69 | the glo|bal envi|
|00002b70| 72 6f 6e 6d 65 6e 74 20 | 72 65 63 6f 72 64 0d 09 |ronment |record..|
|00002b80| 09 4a 53 52 09 53 79 73 | 45 6e 76 69 72 6f 6e 73 |.JSR.Sys|Environs|
|00002b90| 09 09 3b 20 77 65 20 63 | 61 6e 20 69 67 6e 6f 72 |..; we c|an ignor|
|00002ba0| 65 20 61 6e 79 20 65 72 | 72 6f 72 73 20 68 65 72 |e any er|rors her|
|00002bb0| 65 2c 0d 09 09 4d 4f 56 | 45 2e 57 09 28 53 50 29 |e,...MOV|E.W.(SP)|
|00002bc0| 2b 2c 44 30 09 09 3b 20 | 53 79 73 45 6e 76 69 72 |+,D0..; |SysEnvir|
|00002bd0| 6f 6e 73 20 77 69 6c 6c | 20 66 69 6c 6c 20 69 6e |ons will| fill in|
|00002be0| 20 72 65 67 61 72 64 6c | 65 73 73 0d 09 09 4d 4f | regardl|ess...MO|
|00002bf0| 56 45 2e 57 09 47 2e 4d | 61 63 2e 4d 61 63 68 69 |VE.W.G.M|ac.Machi|
|00002c00| 6e 65 54 79 70 65 2c 44 | 30 20 09 3b 20 6e 65 67 |neType,D|0 .; neg|
|00002c10| 69 74 69 76 65 20 76 61 | 6c 75 65 20 6d 65 61 6e |itive va|lue mean|
|00002c20| 73 20 6f 6c 64 20 52 4f | 4d 73 0d 09 09 42 50 4c |s old RO|Ms...BPL|
|00002c30| 2e 53 09 40 32 09 09 09 | 3b 20 31 32 38 6b 20 52 |.S.@2...|; 128k R|
|00002c40| 4f 4d 73 20 6f 72 20 62 | 65 74 74 65 72 2c 20 63 |OMs or b|etter, c|
|00002c50| 6f 6e 74 69 6e 75 65 20 | 6f 6e 0d 09 09 4a 4d 50 |ontinue |on...JMP|
|00002c60| 09 41 6c 65 72 74 55 73 | 65 72 09 09 3b 20 77 65 |.AlertUs|er..; we|
|00002c70| 20 64 6f 6e 27 74 20 77 | 61 6e 74 20 74 6f 20 72 | don't w|ant to r|
|00002c80| 75 6e 20 6f 6e 20 36 34 | 6b 20 52 4f 4d 73 0d 0d |un on 64|k ROMs..|
|00002c90| 2a 20 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 20 |* ------|------- |
|00002ca0| 54 45 53 54 20 46 4f 52 | 20 57 41 49 54 4e 45 58 |TEST FOR| WAITNEX|
|00002cb0| 54 45 56 45 4e 54 20 2d | 2d 2d 2d 2d 2d 2d 2d 2d |TEVENT -|--------|
|00002cc0| 2d 2d 2d 2d 0d 2a 20 31 | 2e 30 32 20 2d 20 4d 6f |----.* 1|.02 - Mo|
|00002cd0| 76 65 20 54 72 61 70 41 | 76 61 69 6c 61 62 6c 65 |ve TrapA|vailable|
|00002ce0| 20 63 61 6c 6c 20 74 6f | 20 61 66 74 65 72 20 53 | call to| after S|
|00002cf0| 79 73 45 6e 76 69 72 6f | 6e 73 20 73 6f 20 74 68 |ysEnviro|ns so th|
|00002d00| 61 74 0d 2a 20 77 65 20 | 63 61 6e 20 74 65 6c 6c |at.* we |can tell|
|00002d10| 20 69 6e 20 54 72 61 70 | 41 76 61 69 6c 61 62 6c | in Trap|Availabl|
|00002d20| 65 20 69 66 20 61 20 74 | 6f 6f 6c 20 74 72 61 70 |e if a t|ool trap|
|00002d30| 20 76 61 6c 75 65 20 69 | 73 20 6f 75 74 20 6f 66 | value i|s out of|
|00002d40| 20 72 61 6e 67 65 2e 0d | 0d 40 32 09 09 43 4c 52 | range..|.@2..CLR|
|00002d50| 2e 57 09 2d 28 53 50 29 | 09 09 09 3b 20 73 70 61 |.W.-(SP)|...; spa|
|00002d60| 63 65 20 66 6f 72 20 72 | 65 73 75 6c 74 20 6f 66 |ce for r|esult of|
|00002d70| 20 74 72 61 70 20 74 65 | 73 74 0d 09 09 4d 4f 56 | trap te|st...MOV|
|00002d80| 45 2e 57 09 23 57 61 69 | 74 4e 65 78 74 45 76 65 |E.W.#Wai|tNextEve|
|00002d90| 6e 74 2c 2d 28 53 50 29 | 09 3b 20 70 61 73 73 20 |nt,-(SP)|.; pass |
|00002da0| 74 68 65 20 74 72 61 70 | 20 6e 75 6d 62 65 72 20 |the trap| number |
|00002db0| 6f 66 20 57 61 69 74 4e | 65 78 74 45 76 65 6e 74 |of WaitN|extEvent|
|00002dc0| 20 74 72 61 70 0d 09 09 | 42 53 52 09 54 72 61 70 | trap...|BSR.Trap|
|00002dd0| 41 76 61 69 6c 61 62 6c | 65 09 09 3b 20 74 65 73 |Availabl|e..; tes|
|00002de0| 74 20 66 6f 72 20 74 68 | 69 73 20 74 72 61 70 0d |t for th|is trap.|
|00002df0| 09 09 4d 4f 56 45 2e 57 | 09 28 53 50 29 2b 2c 47 |..MOVE.W|.(SP)+,G|
|00002e00| 2e 48 61 73 57 4e 45 76 | 65 6e 74 09 3b 20 70 75 |.HasWNEv|ent.; pu|
|00002e10| 74 20 74 68 65 20 72 65 | 73 75 6c 74 20 69 6e 20 |t the re|sult in |
|00002e20| 6f 75 72 20 67 6c 6f 62 | 61 6c 20 66 6c 61 67 0d |our glob|al flag.|
|00002e30| 09 09 09 0d 2a 20 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |....* --|--------|
|00002e40| 2d 2d 2d 20 43 48 45 43 | 4b 20 46 4f 52 20 45 4e |--- CHEC|K FOR EN|
|00002e50| 4f 55 47 48 20 4d 45 4d | 4f 52 59 20 2d 2d 2d 2d |OUGH MEM|ORY ----|
|00002e60| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 0d 2a 20 49 74 20 69 |--------|-.* It i|
|00002e70| 73 20 62 65 74 74 65 72 | 20 74 6f 20 66 69 72 73 |s better| to firs|
|00002e80| 74 20 63 68 65 63 6b 20 | 74 68 65 20 73 69 7a 65 |t check |the size|
|00002e90| 20 6f 66 20 74 68 65 20 | 61 70 70 6c 69 63 61 74 | of the |applicat|
|00002ea0| 69 6f 6e 20 68 65 61 70 | 20 61 67 61 69 6e 73 74 |ion heap| against|
|00002eb0| 20 61 20 76 61 6c 75 65 | 0d 2a 20 74 68 61 74 20 | a value|.* that |
|00002ec0| 79 6f 75 20 68 61 76 65 | 20 64 65 74 65 72 6d 69 |you have| determi|
|00002ed0| 6e 65 64 20 69 73 20 74 | 68 65 20 73 6d 61 6c 6c |ned is t|he small|
|00002ee0| 65 73 74 20 68 65 61 70 | 20 74 68 65 20 61 70 70 |est heap| the app|
|00002ef0| 6c 69 63 61 74 69 6f 6e | 20 63 61 6e 20 72 65 61 |lication| can rea|
|00002f00| 73 6f 6e 61 62 6c 79 0d | 2a 20 77 6f 72 6b 20 69 |sonably.|* work i|
|00002f10| 6e 2e 20 54 68 69 73 20 | 6e 75 6d 62 65 72 20 73 |n. This |number s|
|00002f20| 68 6f 75 6c 64 20 62 65 | 20 64 65 72 69 76 65 64 |hould be| derived|
|00002f30| 20 62 79 20 65 78 61 6d | 69 6e 69 6e 67 20 74 68 | by exam|ining th|
|00002f40| 65 20 73 69 7a 65 20 6f | 66 20 74 68 65 20 68 65 |e size o|f the he|
|00002f50| 61 70 20 74 68 61 74 0d | 2a 20 69 73 20 61 63 74 |ap that.|* is act|
|00002f60| 75 61 6c 6c 79 20 70 72 | 6f 76 69 64 65 64 20 62 |ually pr|ovided b|
|00002f70| 79 20 4d 75 6c 74 69 46 | 69 6e 64 65 72 20 77 68 |y MultiF|inder wh|
|00002f80| 65 6e 20 74 68 65 20 6d | 69 6e 69 6d 75 6d 20 73 |en the m|inimum s|
|00002f90| 69 7a 65 20 72 65 71 75 | 65 73 74 65 64 20 69 73 |ize requ|ested is|
|00002fa0| 20 75 73 65 64 2e 0d 2a | 20 54 68 65 20 64 65 72 | used..*| The der|
|00002fb0| 69 76 61 74 69 6f 6e 20 | 6f 66 20 74 68 65 20 6d |ivation |of the m|
|00002fc0| 69 6e 69 6d 75 6d 20 73 | 69 7a 65 20 72 65 71 75 |inimum s|ize requ|
|00002fd0| 65 73 74 65 64 20 66 72 | 6f 6d 20 4d 75 6c 74 69 |ested fr|om Multi|
|00002fe0| 46 69 6e 64 65 72 20 69 | 73 20 64 65 73 63 72 69 |Finder i|s descri|
|00002ff0| 62 65 64 0d 2a 20 69 6e | 20 41 53 61 6d 70 6c 65 |bed.* in| ASample|
|00003000| 2e 72 2e 20 54 68 65 20 | 63 68 65 63 6b 20 73 68 |.r. The |check sh|
|00003010| 6f 75 6c 64 20 62 65 20 | 6d 61 64 65 20 62 65 63 |ould be |made bec|
|00003020| 61 75 73 65 20 74 68 65 | 20 70 72 65 66 65 72 72 |ause the| preferr|
|00003030| 65 64 20 73 69 7a 65 20 | 63 61 6e 20 65 6e 64 20 |ed size |can end |
|00003040| 75 70 0d 2a 20 62 65 69 | 6e 67 20 73 65 74 20 73 |up.* bei|ng set s|
|00003050| 6d 61 6c 6c 65 72 20 74 | 68 61 6e 20 74 68 65 20 |maller t|han the |
|00003060| 6d 69 6e 69 6d 75 6d 20 | 73 69 7a 65 20 62 79 20 |minimum |size by |
|00003070| 74 68 65 20 75 73 65 72 | 2e 20 54 68 69 73 20 65 |the user|. This e|
|00003080| 78 74 72 61 20 63 68 65 | 63 6b 20 61 63 74 73 20 |xtra che|ck acts |
|00003090| 74 6f 0d 2a 20 69 6e 73 | 75 72 65 20 74 68 61 74 |to.* ins|ure that|
|000030a0| 20 79 6f 75 72 20 61 70 | 70 6c 69 63 61 74 69 6f | your ap|plicatio|
|000030b0| 6e 20 69 73 20 73 74 61 | 72 74 69 6e 67 20 66 72 |n is sta|rting fr|
|000030c0| 6f 6d 20 61 20 73 6f 6c | 69 64 20 6d 65 6d 6f 72 |om a sol|id memor|
|000030d0| 79 20 66 6f 75 6e 64 61 | 74 69 6f 6e 2e 0d 20 0d |y founda|tion.. .|
|000030e0| 2a 20 20 20 20 49 46 20 | 61 70 70 6c 4c 69 6d 69 |* IF |applLimi|
|000030f0| 74 20 2d 20 61 70 70 6c | 5a 6f 6e 65 20 3c 20 4d |t - appl|Zone < M|
|00003100| 69 6e 48 65 61 70 20 54 | 48 45 4e 20 41 6c 65 72 |inHeap T|HEN Aler|
|00003110| 74 55 73 65 72 0d 0d 2a | 20 4e 65 78 74 2c 20 6d |tUser..*| Next, m|
|00003120| 61 6b 65 20 73 75 72 65 | 20 74 68 61 74 20 65 6e |ake sure| that en|
|00003130| 6f 75 67 68 20 6d 65 6d | 6f 72 79 20 69 73 20 66 |ough mem|ory is f|
|00003140| 72 65 65 20 66 6f 72 20 | 79 6f 75 72 20 61 70 70 |ree for |your app|
|00003150| 6c 69 63 61 74 69 6f 6e | 20 74 6f 20 72 75 6e 2e |lication| to run.|
|00003160| 20 49 74 0d 2a 20 69 73 | 20 70 6f 73 73 69 62 6c | It.* is| possibl|
|00003170| 65 20 66 6f 72 20 61 20 | 73 69 74 75 61 74 69 6f |e for a |situatio|
|00003180| 6e 20 74 6f 20 61 72 69 | 73 65 20 77 68 65 72 65 |n to ari|se where|
|00003190| 20 74 68 65 20 68 65 61 | 70 20 6d 61 79 20 68 61 | the hea|p may ha|
|000031a0| 76 65 20 62 65 65 6e 20 | 6f 66 20 72 65 71 75 69 |ve been |of requi|
|000031b0| 72 65 64 0d 2a 20 73 69 | 7a 65 2c 20 62 75 74 20 |red.* si|ze, but |
|000031c0| 61 20 6c 61 72 67 65 20 | 73 63 72 61 70 20 77 61 |a large |scrap wa|
|000031d0| 73 20 6c 6f 61 64 65 64 | 20 77 68 69 63 68 20 6c |s loaded| which l|
|000031e0| 65 66 74 20 74 6f 6f 20 | 6c 69 74 74 6c 65 20 6d |eft too |little m|
|000031f0| 65 6d 6f 72 79 2e 20 54 | 6f 20 63 68 65 63 6b 20 |emory. T|o check |
|00003200| 66 6f 72 0d 2a 20 74 68 | 69 73 2c 20 63 61 6c 6c |for.* th|is, call|
|00003210| 20 50 75 72 67 65 53 70 | 61 63 65 20 61 6e 64 20 | PurgeSp|ace and |
|00003220| 63 6f 6d 70 61 72 65 20 | 74 68 65 20 72 65 73 75 |compare |the resu|
|00003230| 6c 74 20 77 69 74 68 20 | 61 20 76 61 6c 75 65 20 |lt with |a value |
|00003240| 74 68 61 74 20 79 6f 75 | 20 68 61 76 65 20 64 65 |that you| have de|
|00003250| 74 65 72 6d 69 6e 65 64 | 0d 2a 20 69 73 20 74 68 |termined|.* is th|
|00003260| 65 20 6d 69 6e 69 6d 75 | 6d 20 61 6d 6f 75 6e 74 |e minimu|m amount|
|00003270| 20 6f 66 20 66 72 65 65 | 20 6d 65 6d 6f 72 79 20 | of free| memory |
|00003280| 79 6f 75 72 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |your app|lication|
|00003290| 20 6e 65 65 64 73 20 61 | 74 20 69 6e 69 74 69 61 | needs a|t initia|
|000032a0| 6c 69 7a 61 74 69 6f 6e | 2e 0d 2a 20 54 68 69 73 |lization|..* This|
|000032b0| 20 6e 75 6d 62 65 72 20 | 63 61 6e 20 62 65 20 64 | number |can be d|
|000032c0| 65 72 69 76 65 64 20 73 | 65 76 65 72 61 6c 20 64 |erived s|everal d|
|000032d0| 69 66 66 65 72 65 6e 74 | 20 77 61 79 73 2e 20 4f |ifferent| ways. O|
|000032e0| 6e 65 20 77 61 79 20 74 | 68 61 74 20 69 73 20 66 |ne way t|hat is f|
|000032f0| 61 69 72 6c 79 0d 2a 20 | 73 74 72 61 69 67 68 74 |airly.* |straight|
|00003300| 66 6f 72 77 61 72 64 20 | 69 73 20 74 6f 20 72 75 |forward |is to ru|
|00003310| 6e 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f |n the ap|plicatio|
|00003320| 6e 20 69 6e 20 74 68 65 | 20 6d 69 6e 69 6d 75 6d |n in the| minimum|
|00003330| 20 73 69 7a 65 20 63 6f | 6e 66 69 67 75 72 61 74 | size co|nfigurat|
|00003340| 69 6f 6e 0d 2a 20 61 73 | 20 64 65 73 63 72 69 62 |ion.* as| describ|
|00003350| 65 64 20 70 72 65 76 69 | 6f 75 73 6c 79 2e 20 43 |ed previ|ously. C|
|00003360| 61 6c 6c 20 50 75 72 67 | 65 53 70 61 63 65 20 61 |all Purg|eSpace a|
|00003370| 74 20 69 6e 69 74 69 61 | 6c 69 7a 61 74 69 6f 6e |t initia|lization|
|00003380| 20 61 6e 64 20 65 78 61 | 6d 69 6e 65 20 74 68 65 | and exa|mine the|
|00003390| 20 76 61 6c 75 65 0d 2a | 20 72 65 74 75 72 6e 65 | value.*| returne|
|000033a0| 64 2e 20 48 6f 77 65 76 | 65 72 2c 20 79 6f 75 20 |d. Howev|er, you |
|000033b0| 73 68 6f 75 6c 64 20 6d | 61 6b 65 20 73 75 72 65 |should m|ake sure|
|000033c0| 20 74 68 61 74 20 74 68 | 69 73 20 72 65 73 75 6c | that th|is resul|
|000033d0| 74 20 69 73 20 6e 6f 74 | 20 62 65 69 6e 67 20 6d |t is not| being m|
|000033e0| 6f 64 69 66 69 65 64 0d | 2a 20 62 79 20 74 68 65 |odified.|* by the|
|000033f0| 20 73 63 72 61 70 27 73 | 20 70 72 65 73 65 6e 63 | scrap's| presenc|
|00003400| 65 2e 20 59 6f 75 20 63 | 61 6e 20 64 6f 20 74 68 |e. You c|an do th|
|00003410| 61 74 20 62 79 20 63 61 | 6c 6c 69 6e 67 20 5a 65 |at by ca|lling Ze|
|00003420| 72 6f 53 63 72 61 70 20 | 62 65 66 6f 72 65 20 63 |roScrap |before c|
|00003430| 61 6c 6c 69 6e 67 0d 2a | 20 50 75 72 67 65 53 70 |alling.*| PurgeSp|
|00003440| 61 63 65 2e 20 4d 61 6b | 65 20 73 75 72 65 20 74 |ace. Mak|e sure t|
|00003450| 6f 20 72 65 6d 6f 76 65 | 20 74 68 61 74 20 63 61 |o remove| that ca|
|00003460| 6c 6c 20 62 65 66 6f 72 | 65 20 73 68 69 70 70 69 |ll befor|e shippi|
|00003470| 6e 67 2c 20 74 68 6f 75 | 67 68 2e 0d 20 0d 2a 20 |ng, thou|gh.. .* |
|00003480| 54 68 65 20 65 78 74 72 | 61 20 62 65 6e 65 66 69 |The extr|a benefi|
|00003490| 74 20 74 6f 20 77 61 69 | 74 69 6e 67 20 75 6e 74 |t to wai|ting unt|
|000034a0| 69 6c 20 61 66 74 65 72 | 20 74 68 65 20 54 6f 6f |il after| the Too|
|000034b0| 6c 62 6f 78 20 4d 61 6e | 61 67 65 72 73 20 68 61 |lbox Man|agers ha|
|000034c0| 76 65 20 62 65 65 6e 20 | 69 6e 69 74 69 61 6c 69 |ve been |initiali|
|000034d0| 7a 65 64 0d 2a 20 62 65 | 66 6f 72 65 20 63 68 65 |zed.* be|fore che|
|000034e0| 63 6b 69 6e 67 20 6d 65 | 6d 6f 72 79 20 69 73 20 |cking me|mory is |
|000034f0| 74 68 61 74 20 77 65 20 | 63 61 6e 20 6e 6f 77 20 |that we |can now |
|00003500| 67 69 76 65 20 74 68 65 | 20 75 73 65 72 20 61 6e |give the| user an|
|00003510| 20 61 6c 65 72 74 20 74 | 6f 20 74 65 6c 6c 20 68 | alert t|o tell h|
|00003520| 69 6d 20 77 68 61 74 0d | 2a 20 68 61 70 70 65 6e |im what.|* happen|
|00003530| 65 64 2e 20 41 6c 74 68 | 6f 75 67 68 20 69 74 20 |ed. Alth|ough it |
|00003540| 69 73 20 70 6f 73 73 69 | 62 6c 65 20 74 68 61 74 |is possi|ble that|
|00003550| 20 74 68 65 20 6d 65 6d | 6f 72 79 20 73 69 74 75 | the mem|ory situ|
|00003560| 61 74 69 6f 6e 20 63 6f | 75 6c 64 20 62 65 20 77 |ation co|uld be w|
|00003570| 6f 72 73 65 6e 65 64 20 | 62 79 0d 2a 20 64 69 73 |orsened |by.* dis|
|00003580| 70 6c 61 79 69 6e 67 20 | 61 6e 20 61 6c 65 72 74 |playing |an alert|
|00003590| 2c 20 4d 75 6c 74 69 46 | 69 6e 64 65 72 20 77 6f |, MultiF|inder wo|
|000035a0| 75 6c 64 20 67 72 61 63 | 65 66 75 6c 6c 79 20 65 |uld grac|efully e|
|000035b0| 78 69 74 20 74 68 65 20 | 61 70 70 6c 69 63 61 74 |xit the |applicat|
|000035c0| 69 6f 6e 20 77 69 74 68 | 0d 2a 20 61 6e 20 69 6e |ion with|.* an in|
|000035d0| 66 6f 72 6d 61 74 69 76 | 65 20 61 6c 65 72 74 20 |formativ|e alert |
|000035e0| 69 66 20 6d 65 6d 6f 72 | 79 20 62 65 63 61 6d 65 |if memor|y became|
|000035f0| 20 63 72 69 74 69 63 61 | 6c 2e 20 48 65 72 65 20 | critica|l. Here |
|00003600| 77 65 20 61 72 65 20 61 | 63 74 69 6e 67 20 6d 6f |we are a|cting mo|
|00003610| 72 65 0d 2a 20 69 6e 20 | 61 20 70 72 65 76 65 6e |re.* in |a preven|
|00003620| 74 61 74 69 76 65 20 6d | 61 6e 6e 65 72 20 74 6f |tative m|anner to|
|00003630| 20 61 76 6f 69 64 20 66 | 75 74 75 72 65 20 64 69 | avoid f|uture di|
|00003640| 73 61 73 74 65 72 20 66 | 72 6f 6d 20 6c 6f 77 2d |saster f|rom low-|
|00003650| 6d 65 6d 6f 72 79 20 70 | 72 6f 62 6c 65 6d 73 2e |memory p|roblems.|
|00003660| 0d 20 0d 09 09 4d 4f 56 | 45 2e 4c 09 61 70 70 6c |. ...MOV|E.L.appl|
|00003670| 4c 69 6d 69 74 2c 44 31 | 09 09 3b 20 67 65 74 20 |Limit,D1|..; get |
|00003680| 70 6f 69 6e 74 65 72 20 | 74 6f 20 41 70 70 6c 4c |pointer |to ApplL|
|00003690| 69 6d 69 74 0d 09 09 4d | 4f 56 45 2e 4c 09 61 70 |imit...M|OVE.L.ap|
|000036a0| 70 6c 5a 6f 6e 65 2c 44 | 30 09 09 3b 20 67 65 74 |plZone,D|0..; get|
|000036b0| 20 70 6f 69 6e 74 65 72 | 20 74 6f 20 41 70 70 6c | pointer| to Appl|
|000036c0| 69 63 5a 6f 6e 65 0d 09 | 09 53 55 42 2e 4c 09 44 |icZone..|.SUB.L.D|
|000036d0| 30 2c 44 31 09 09 09 3b | 20 73 75 62 74 72 61 63 |0,D1...;| subtrac|
|000036e0| 74 20 74 68 65 20 41 70 | 70 6c 69 63 5a 6f 6e 65 |t the Ap|plicZone|
|000036f0| 20 66 72 6f 6d 20 41 70 | 70 6c 4c 69 6d 69 74 0d | from Ap|plLimit.|
|00003700| 09 09 43 4d 50 49 2e 4c | 09 23 4d 69 6e 48 65 61 |..CMPI.L|.#MinHea|
|00003710| 70 2c 44 31 09 09 3b 20 | 64 6f 20 77 65 20 68 61 |p,D1..; |do we ha|
|00003720| 76 65 20 65 6e 6f 75 67 | 68 20 6d 65 6d 6f 72 79 |ve enoug|h memory|
|00003730| 3f 0d 09 09 42 50 4c 2e | 53 09 40 33 09 09 09 3b |?...BPL.|S.@3...;|
|00003740| 20 79 65 73 20 77 65 20 | 64 6f 2c 20 63 6f 6e 74 | yes we |do, cont|
|00003750| 69 6e 75 65 20 6f 6e 0d | 09 09 4a 4d 50 09 41 6c |inue on.|..JMP.Al|
|00003760| 65 72 74 55 73 65 72 09 | 09 3b 20 6e 6f 2c 20 72 |ertUser.|.; no, r|
|00003770| 65 70 6f 72 74 20 74 68 | 65 20 65 72 72 6f 72 0d |eport th|e error.|
|00003780| 09 09 0d 40 33 09 09 5f | 50 75 72 67 65 53 70 61 |...@3.._|PurgeSpa|
|00003790| 63 65 09 09 09 3b 20 72 | 65 73 75 6c 74 73 20 77 |ce...; r|esults w|
|000037a0| 69 6c 6c 20 62 65 20 69 | 6e 20 41 30 20 61 6e 64 |ill be i|n A0 and|
|000037b0| 20 44 30 0d 09 09 43 4d | 50 49 2e 4c 09 23 4d 69 | D0...CM|PI.L.#Mi|
|000037c0| 6e 53 70 61 63 65 2c 44 | 30 09 09 3b 20 64 6f 20 |nSpace,D|0..; do |
|000037d0| 77 65 20 68 61 76 65 20 | 65 6e 6f 75 67 68 20 70 |we have |enough p|
|000037e0| 75 72 67 65 61 62 6c 65 | 20 73 70 61 63 65 3f 0d |urgeable| space?.|
|000037f0| 09 09 42 50 4c 2e 53 09 | 40 34 0d 09 09 4a 4d 50 |..BPL.S.|@4...JMP|
|00003800| 09 41 6c 65 72 74 55 73 | 65 72 09 09 3b 20 6e 6f |.AlertUs|er..; no|
|00003810| 2c 20 72 65 70 6f 72 74 | 20 74 68 65 20 65 72 72 |, report| the err|
|00003820| 6f 72 0d 0d 2a 20 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |or..* --|--------|
|00003830| 2d 2d 2d 20 53 45 54 20 | 55 50 20 54 48 45 20 54 |--- SET |UP THE T|
|00003840| 52 41 46 46 49 43 20 4c | 49 47 48 54 20 57 49 4e |RAFFIC L|IGHT WIN|
|00003850| 44 4f 57 20 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |DOW ----|--------|
|00003860| 2d 0d 2a 20 57 65 20 77 | 69 6c 6c 20 61 6c 6c 6f |-.* We w|ill allo|
|00003870| 63 61 74 65 20 6f 75 72 | 20 6f 77 6e 20 77 69 6e |cate our| own win|
|00003880| 64 6f 77 20 73 74 6f 72 | 61 67 65 20 69 6e 73 74 |dow stor|age inst|
|00003890| 65 61 64 20 6f 66 20 6c | 65 74 74 69 6e 67 20 74 |ead of l|etting t|
|000038a0| 68 65 20 57 69 6e 64 6f | 77 20 4d 61 6e 61 67 65 |he Windo|w Manage|
|000038b0| 72 0d 2a 20 66 6f 72 20 | 74 77 6f 20 72 65 61 73 |r.* for |two reas|
|000038c0| 6f 6e 73 2e 20 4f 6e 65 | 2c 20 47 65 74 4e 65 77 |ons. One|, GetNew|
|000038d0| 57 69 6e 64 6f 77 20 6c | 6f 63 6b 73 20 74 68 65 |Window l|ocks the|
|000038e0| 20 27 57 49 4e 44 27 20 | 72 65 73 6f 75 72 63 65 | 'WIND' |resource|
|000038f0| 20 68 61 6e 64 6c 65 20 | 62 65 66 6f 72 65 20 63 | handle |before c|
|00003900| 61 6c 6c 69 6e 67 0d 2a | 20 4e 65 77 57 69 6e 64 |alling.*| NewWind|
|00003910| 6f 77 20 61 6e 64 20 74 | 68 69 73 20 63 61 6e 20 |ow and t|his can |
|00003920| 6c 65 61 64 20 74 6f 20 | 68 65 61 70 20 66 72 61 |lead to |heap fra|
|00003930| 67 6d 65 6e 74 61 74 69 | 6f 6e 2e 20 20 54 77 6f |gmentati|on. Two|
|00003940| 2c 20 69 74 20 74 61 6b | 65 73 20 6a 75 73 74 20 |, it tak|es just |
|00003950| 61 73 20 6d 75 63 68 20 | 74 69 6d 65 0d 2a 20 66 |as much |time.* f|
|00003960| 6f 72 20 4e 65 77 57 69 | 6e 64 6f 77 20 74 6f 20 |or NewWi|ndow to |
|00003970| 67 65 74 20 74 68 65 20 | 6d 65 6d 6f 72 79 20 61 |get the |memory a|
|00003980| 73 20 69 74 20 64 6f 65 | 73 20 66 6f 72 20 75 73 |s it doe|s for us|
|00003990| 20 74 6f 20 67 65 74 20 | 69 74 2e 0d 0d 40 34 09 | to get |it...@4.|
|000039a0| 09 4d 4f 56 45 2e 4c 09 | 23 77 69 6e 64 6f 77 53 |.MOVE.L.|#windowS|
|000039b0| 69 7a 65 2c 44 30 0d 09 | 09 5f 4e 65 77 50 74 72 |ize,D0..|._NewPtr|
|000039c0| 20 2c 43 6c 65 61 72 09 | 09 09 3b 20 63 72 65 61 | ,Clear.|..; crea|
|000039d0| 74 65 20 61 20 70 6f 69 | 6e 74 65 72 20 69 6e 20 |te a poi|nter in |
|000039e0| 41 30 20 61 6e 64 20 63 | 6c 65 61 72 20 6d 65 6d |A0 and c|lear mem|
|000039f0| 6f 72 79 0d 09 09 43 4d | 50 41 2e 4c 09 23 4e 49 |ory...CM|PA.L.#NI|
|00003a00| 4c 2c 41 30 09 09 09 3b | 20 63 68 65 63 6b 20 66 |L,A0...;| check f|
|00003a10| 6f 72 20 4e 49 4c 20 70 | 6f 69 6e 74 65 72 20 28 |or NIL p|ointer (|
|00003a20| 72 65 73 75 6c 74 20 69 | 6e 20 44 30 29 0d 09 09 |result i|n D0)...|
|00003a30| 42 4e 45 2e 53 09 40 35 | 09 09 09 3b 20 6d 75 73 |BNE.S.@5|...; mus|
|00003a40| 74 20 68 61 76 65 20 62 | 65 65 6e 20 61 20 76 61 |t have b|een a va|
|00003a50| 6c 69 64 20 70 6f 69 6e | 74 65 72 0d 09 09 4a 4d |lid poin|ter...JM|
|00003a60| 50 09 41 6c 65 72 74 55 | 73 65 72 09 09 3b 20 63 |P.AlertU|ser..; c|
|00003a70| 6f 75 6c 64 6e 27 74 20 | 67 65 74 20 6d 65 6d 6f |ouldn't |get memo|
|00003a80| 72 79 2c 20 72 65 70 6f | 72 74 20 65 72 72 6f 72 |ry, repo|rt error|
|00003a90| 0d 09 09 0d 40 35 09 09 | 43 4c 52 2e 4c 09 2d 28 |....@5..|CLR.L.-(|
|00003aa0| 53 50 29 09 09 09 3b 20 | 63 72 65 61 74 65 20 73 |SP)...; |create s|
|00003ab0| 70 61 63 65 20 66 6f 72 | 20 72 65 73 75 6c 74 0d |pace for| result.|
|00003ac0| 09 09 4d 4f 56 45 2e 57 | 09 23 72 57 69 6e 64 6f |..MOVE.W|.#rWindo|
|00003ad0| 77 2c 2d 28 53 50 29 09 | 09 3b 20 6f 75 74 20 77 |w,-(SP).|.; out w|
|00003ae0| 69 6e 64 6f 77 20 72 65 | 73 6f 75 72 63 65 20 64 |indow re|source d|
|00003af0| 65 66 69 6e 69 74 69 6f | 6e 0d 09 09 4d 4f 56 45 |efinitio|n...MOVE|
|00003b00| 2e 4c 09 41 30 2c 2d 28 | 53 50 29 09 09 3b 20 6f |.L.A0,-(|SP)..; o|
|00003b10| 75 72 20 77 69 6e 64 6f | 77 20 72 65 63 6f 72 64 |ur windo|w record|
|00003b20| 20 73 74 6f 72 61 67 65 | 0d 09 09 4d 4f 56 45 2e | storage|...MOVE.|
|00003b30| 4c 09 23 2d 31 2c 2d 28 | 53 50 29 09 09 3b 20 6d |L.#-1,-(|SP)..; m|
|00003b40| 61 6b 65 20 69 74 20 6f | 6e 20 74 6f 70 0d 09 09 |ake it o|n top...|
|00003b50| 5f 47 65 74 4e 65 77 57 | 69 6e 64 6f 77 09 09 09 |_GetNewW|indow...|
|00003b60| 3b 20 63 72 65 61 74 65 | 20 74 68 65 20 77 69 6e |; create| the win|
|00003b70| 64 6f 77 0d 09 09 4d 4f | 56 45 2e 4c 09 28 53 50 |dow...MO|VE.L.(SP|
|00003b80| 29 2b 2c 44 30 09 09 3b | 20 77 65 27 72 65 20 6e |)+,D0..;| we're n|
|00003b90| 6f 74 20 73 61 76 69 6e | 67 20 6f 75 72 20 77 69 |ot savin|g our wi|
|00003ba0| 6e 64 6f 77 20 70 6f 69 | 6e 74 65 72 0d 09 09 0d |ndow poi|nter....|
|00003bb0| 2a 20 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 20 |* ------|------- |
|00003bc0| 53 45 54 20 55 50 20 54 | 48 45 20 4d 45 4e 55 53 |SET UP T|HE MENUS|
|00003bd0| 20 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 0d 09 | -------|------..|
|00003be0| 0d 09 09 43 4c 52 2e 4c | 09 2d 28 53 50 29 09 09 |...CLR.L|.-(SP)..|
|00003bf0| 09 3b 20 73 70 61 63 65 | 20 66 6f 72 20 4d 65 6e |.; space| for Men|
|00003c00| 75 42 61 72 20 68 61 6e | 64 6c 65 0d 09 09 4d 4f |uBar han|dle...MO|
|00003c10| 56 45 2e 57 09 23 72 4d | 65 6e 75 42 61 72 2c 2d |VE.W.#rM|enuBar,-|
|00003c20| 28 53 50 29 09 09 3b 20 | 6f 75 72 20 4d 65 6e 75 |(SP)..; |our Menu|
|00003c30| 42 61 72 20 72 65 73 6f | 75 72 63 65 0d 09 09 5f |Bar reso|urce..._|
|00003c40| 47 65 74 4e 65 77 4d 42 | 61 72 09 09 09 3b 20 74 |GetNewMB|ar...; t|
|00003c50| 68 65 20 6d 6f 64 65 72 | 6e 20 77 61 79 2c 20 67 |he moder|n way, g|
|00003c60| 65 74 20 61 20 4d 65 6e | 75 42 61 72 0d 09 09 4d |et a Men|uBar...M|
|00003c70| 4f 56 45 2e 4c 09 28 53 | 50 29 2c 43 75 72 4d 42 |OVE.L.(S|P),CurMB|
|00003c80| 61 72 28 41 36 29 0d 09 | 09 5f 53 65 74 4d 65 6e |ar(A6)..|._SetMen|
|00003c90| 75 42 61 72 0d 09 09 4d | 4f 56 45 41 2e 4c 09 43 |uBar...M|OVEA.L.C|
|00003ca0| 75 72 4d 42 61 72 28 41 | 36 29 2c 41 30 09 09 3b |urMBar(A|6),A0..;|
|00003cb0| 20 77 65 27 72 65 20 64 | 6f 6e 65 20 77 69 74 68 | we're d|one with|
|00003cc0| 20 74 68 61 74 20 68 61 | 6e 64 6c 65 0d 09 09 5f | that ha|ndle..._|
|00003cd0| 44 69 73 70 6f 73 48 61 | 6e 64 6c 65 09 09 09 3b |DisposHa|ndle...;|
|00003ce0| 20 74 68 65 72 65 20 69 | 73 20 61 20 72 65 73 75 | there i|s a resu|
|00003cf0| 6c 74 20 69 6e 20 44 30 | 0d 09 09 43 4c 52 2e 4c |lt in D0|...CLR.L|
|00003d00| 09 2d 28 53 50 29 0d 09 | 09 4d 4f 56 45 2e 57 09 |.-(SP)..|.MOVE.W.|
|00003d10| 23 41 70 70 6c 65 4d 65 | 6e 75 2c 2d 28 53 50 29 |#AppleMe|nu,-(SP)|
|00003d20| 0d 09 09 5f 47 65 74 4d | 48 61 6e 64 6c 65 09 09 |..._GetM|Handle..|
|00003d30| 09 3b 20 70 75 74 20 41 | 70 70 6c 65 20 6d 65 6e |.; put A|pple men|
|00003d40| 75 20 68 61 6e 64 6c 65 | 20 6f 6e 20 73 74 61 63 |u handle| on stac|
|00003d50| 6b 0d 09 09 4d 4f 56 45 | 2e 4c 09 23 27 44 52 56 |k...MOVE|.L.#'DRV|
|00003d60| 52 27 2c 2d 28 53 50 29 | 09 09 3b 20 67 65 74 20 |R',-(SP)|..; get |
|00003d70| 61 6c 6c 20 74 68 65 20 | 44 41 73 0d 09 09 5f 41 |all the |DAs..._A|
|00003d80| 64 64 52 65 73 4d 65 6e | 75 0d 09 09 5f 44 72 61 |ddResMen|u..._Dra|
|00003d90| 77 4d 65 6e 75 42 61 72 | 0d 0d 2a 20 2d 2d 2d 2d |wMenuBar|..* ----|
|00003da0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 20 53 45 54 20 55 50 |--------|- SET UP|
|00003db0| 20 52 45 43 54 53 20 46 | 4f 52 20 54 48 45 20 4c | RECTS F|OR THE L|
|00003dc0| 49 47 48 54 53 20 20 2d | 2d 2d 2d 2d 2d 2d 2d 2d |IGHTS -|--------|
|00003dd0| 2d 2d 2d 2d 0d 0d 09 09 | 43 4c 52 2e 57 09 2d 28 |----....|CLR.W.-(|
|00003de0| 53 50 29 09 09 09 3b 20 | 73 70 61 63 65 20 66 6f |SP)...; |space fo|
|00003df0| 72 20 72 65 73 75 6c 74 | 20 6f 66 20 47 6f 47 65 |r result| of GoGe|
|00003e00| 74 52 65 63 74 0d 09 09 | 4d 4f 56 45 2e 57 09 23 |tRect...|MOVE.W.#|
|00003e10| 72 53 74 6f 70 52 65 63 | 74 2c 2d 28 53 50 29 09 |rStopRec|t,-(SP).|
|00003e20| 3b 20 70 61 73 73 20 74 | 68 65 20 73 74 6f 70 20 |; pass t|he stop |
|00003e30| 6c 69 67 68 74 27 73 20 | 72 65 63 74 0d 09 09 50 |light's |rect...P|
|00003e40| 45 41 09 47 2e 53 74 6f | 70 52 65 63 74 09 09 3b |EA.G.Sto|pRect..;|
|00003e50| 20 70 61 73 73 20 74 68 | 65 20 73 74 6f 70 20 6c | pass th|e stop l|
|00003e60| 69 67 68 74 27 73 20 72 | 65 63 74 20 70 6f 69 6e |ight's r|ect poin|
|00003e70| 74 65 72 0d 09 09 42 53 | 52 09 47 6f 47 65 74 52 |ter...BS|R.GoGetR|
|00003e80| 65 63 74 09 09 3b 20 67 | 6f 20 67 65 74 20 74 68 |ect..; g|o get th|
|00003e90| 65 20 73 74 6f 70 20 6c | 69 67 68 74 20 72 65 63 |e stop l|ight rec|
|00003ea0| 74 0d 09 09 4d 4f 56 45 | 2e 57 09 28 53 50 29 2b |t...MOVE|.W.(SP)+|
|00003eb0| 2c 44 30 09 09 3b 20 67 | 65 74 20 74 68 65 20 72 |,D0..; g|et the r|
|00003ec0| 65 73 75 6c 74 20 6f 66 | 20 47 6f 47 65 74 52 65 |esult of| GoGetRe|
|00003ed0| 63 74 0d 09 09 43 4d 50 | 49 2e 57 09 23 54 72 75 |ct...CMP|I.W.#Tru|
|00003ee0| 65 2c 44 30 09 09 3b 20 | 64 69 64 20 77 65 20 67 |e,D0..; |did we g|
|00003ef0| 65 74 20 74 68 65 20 52 | 45 43 54 20 72 65 73 6f |et the R|ECT reso|
|00003f00| 75 72 63 65 3f 0d 09 09 | 42 45 51 2e 53 09 40 36 |urce?...|BEQ.S.@6|
|00003f10| 09 09 09 3b 20 79 65 73 | 2c 20 74 68 65 6e 20 63 |...; yes|, then c|
|00003f20| 6f 6e 74 69 6e 75 65 0d | 09 09 4a 4d 50 09 41 6c |ontinue.|..JMP.Al|
|00003f30| 65 72 74 55 73 65 72 09 | 09 3b 20 6f 74 68 65 72 |ertUser.|.; other|
|00003f40| 77 69 73 65 2c 20 77 65 | 27 72 65 20 68 61 76 69 |wise, we|'re havi|
|00003f50| 6e 67 20 73 6f 6d 65 20 | 74 72 6f 75 62 6c 65 0d |ng some |trouble.|
|00003f60| 09 09 0d 40 36 09 09 43 | 4c 52 2e 57 09 2d 28 53 |...@6..C|LR.W.-(S|
|00003f70| 50 29 09 09 09 3b 20 73 | 70 61 63 65 20 66 6f 72 |P)...; s|pace for|
|00003f80| 20 72 65 73 75 6c 74 20 | 6f 66 20 47 6f 47 65 74 | result |of GoGet|
|00003f90| 52 65 63 74 0d 09 09 4d | 4f 56 45 2e 57 09 23 72 |Rect...M|OVE.W.#r|
|00003fa0| 47 6f 52 65 63 74 2c 2d | 28 53 50 29 09 09 3b 20 |GoRect,-|(SP)..; |
|00003fb0| 70 61 73 73 20 74 68 65 | 20 67 6f 20 6c 69 67 68 |pass the| go ligh|
|00003fc0| 74 27 73 20 72 65 63 74 | 0d 09 09 50 45 41 09 47 |t's rect|...PEA.G|
|00003fd0| 2e 47 6f 52 65 63 74 09 | 09 3b 20 70 61 73 73 20 |.GoRect.|.; pass |
|00003fe0| 74 68 65 20 67 6f 20 6c | 69 67 68 74 27 73 20 72 |the go l|ight's r|
|00003ff0| 65 63 74 20 70 6f 69 6e | 74 65 72 0d 09 09 42 53 |ect poin|ter...BS|
|00004000| 52 09 47 6f 47 65 74 52 | 65 63 74 09 09 3b 20 67 |R.GoGetR|ect..; g|
|00004010| 6f 20 67 65 74 20 74 68 | 65 20 67 6f 20 6c 69 67 |o get th|e go lig|
|00004020| 68 74 20 72 65 63 74 0d | 09 09 4d 4f 56 45 2e 57 |ht rect.|..MOVE.W|
|00004030| 09 28 53 50 29 2b 2c 44 | 30 09 09 3b 20 67 65 74 |.(SP)+,D|0..; get|
|00004040| 20 74 68 65 20 72 65 73 | 75 6c 74 20 6f 66 20 47 | the res|ult of G|
|00004050| 6f 47 65 74 52 65 63 74 | 0d 09 09 43 4d 50 49 2e |oGetRect|...CMPI.|
|00004060| 57 09 23 54 72 75 65 2c | 44 30 09 09 3b 20 64 69 |W.#True,|D0..; di|
|00004070| 64 20 77 65 20 67 65 74 | 20 74 68 65 20 52 45 43 |d we get| the REC|
|00004080| 54 20 72 65 73 6f 75 72 | 63 65 3f 0d 09 09 42 45 |T resour|ce?...BE|
|00004090| 51 2e 53 09 45 78 69 74 | 09 09 09 3b 20 79 65 73 |Q.S.Exit|...; yes|
|000040a0| 2c 20 74 68 65 6e 20 63 | 6f 6e 74 69 6e 75 65 0d |, then c|ontinue.|
|000040b0| 09 09 4a 4d 50 09 41 6c | 65 72 74 55 73 65 72 09 |..JMP.Al|ertUser.|
|000040c0| 09 3b 20 6f 74 68 65 72 | 77 69 73 65 2c 20 77 65 |.; other|wise, we|
|000040d0| 27 72 65 20 68 61 76 69 | 6e 67 20 73 6f 6d 65 20 |'re havi|ng some |
|000040e0| 74 72 6f 75 62 6c 65 0d | 09 09 09 09 0d 45 78 69 |trouble.|.....Exi|
|000040f0| 74 09 09 4d 4f 56 45 4d | 2e 4c 09 28 53 50 29 2b |t..MOVEM|.L.(SP)+|
|00004100| 2c 43 6f 75 6e 74 52 65 | 67 09 09 3b 20 72 65 73 |,CountRe|g..; res|
|00004110| 74 6f 72 65 20 74 68 65 | 20 72 65 67 69 73 74 6f |tore the| registo|
|00004120| 72 73 0d 09 09 55 4e 4c | 4b 09 41 36 09 09 09 3b |rs...UNL|K.A6...;|
|00004130| 20 64 65 73 74 72 6f 79 | 20 74 68 65 20 6c 69 6e | destroy| the lin|
|00004140| 6b 0d 09 09 4d 4f 56 45 | 41 2e 4c 09 28 53 50 29 |k...MOVE|A.L.(SP)|
|00004150| 2b 2c 41 30 09 09 3b 20 | 70 75 6c 6c 20 6f 66 66 |+,A0..; |pull off|
|00004160| 20 74 68 65 20 72 65 74 | 75 72 6e 20 61 64 64 72 | the ret|urn addr|
|00004170| 65 73 73 0d 09 09 41 44 | 44 41 2e 4c 09 23 50 61 |ess...AD|DA.L.#Pa|
|00004180| 72 61 6d 53 69 7a 65 2c | 53 50 09 09 3b 20 73 74 |ramSize,|SP..; st|
|00004190| 72 69 70 20 61 6c 6c 20 | 6f 66 20 74 68 65 20 63 |rip all |of the c|
|000041a0| 61 6c 6c 65 72 27 73 20 | 70 61 72 61 6d 65 74 65 |aller's |paramete|
|000041b0| 72 73 0d 09 09 4a 4d 50 | 09 28 41 30 29 09 09 09 |rs...JMP|.(A0)...|
|000041c0| 3b 20 72 65 74 75 72 6e | 20 74 6f 20 74 68 65 20 |; return| to the |
|000041d0| 63 61 6c 6c 65 72 0d 0d | 09 09 44 62 67 49 6e 66 |caller..|..DbgInf|
|000041e0| 6f 09 49 6e 69 74 69 61 | 6c 7a 09 09 3b 20 74 68 |o.Initia|lz..; th|
|000041f0| 69 73 20 6e 61 6d 65 20 | 77 69 6c 6c 20 61 70 70 |is name |will app|
|00004200| 65 61 72 20 69 6e 20 74 | 68 65 20 64 65 62 75 67 |ear in t|he debug|
|00004210| 67 65 72 0d 09 09 45 4e | 44 50 0d 0d 2a 20 3d 3d |ger...EN|DP..* ==|
|00004220| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004230| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004240| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 0d 2a |========|======.*|
|00004250| 20 50 52 4f 43 45 44 55 | 52 45 20 44 6f 43 6f 6e | PROCEDU|RE DoCon|
|00004260| 74 65 6e 74 43 6c 69 63 | 6b 28 77 69 6e 64 6f 77 |tentClic|k(window|
|00004270| 3a 20 57 69 6e 64 6f 77 | 50 74 72 3b 20 65 76 65 |: Window|Ptr; eve|
|00004280| 6e 74 3a 20 45 76 65 6e | 74 52 65 63 6f 72 64 29 |nt: Even|tRecord)|
|00004290| 3b 0d 2a 20 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |;.* ====|========|
|000042a0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000042b0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000042c0| 3d 3d 3d 3d 0d 2a 20 54 | 68 69 73 20 69 73 20 63 |====.* T|his is c|
|000042d0| 61 6c 6c 65 64 20 77 68 | 65 6e 20 61 20 6d 6f 75 |alled wh|en a mou|
|000042e0| 73 65 2d 64 6f 77 6e 20 | 65 76 65 6e 74 20 6f 63 |se-down |event oc|
|000042f0| 63 75 72 73 20 69 6e 20 | 74 68 65 20 63 6f 6e 74 |curs in |the cont|
|00004300| 65 6e 74 20 6f 66 20 61 | 20 77 69 6e 64 6f 77 2e |ent of a| window.|
|00004310| 0d 2a 20 4f 74 68 65 72 | 20 61 70 70 6c 69 63 61 |.* Other| applica|
|00004320| 74 69 6f 6e 73 20 6d 69 | 67 68 74 20 77 61 6e 74 |tions mi|ght want|
|00004330| 20 74 6f 20 63 61 6c 6c | 20 46 69 6e 64 43 6f 6e | to call| FindCon|
|00004340| 74 72 6f 6c 2c 20 54 45 | 43 6c 69 63 6b 2c 20 65 |trol, TE|Click, e|
|00004350| 74 63 2e 2c 20 74 6f 0d | 2a 20 66 75 72 74 68 65 |tc., to.|* furthe|
|00004360| 72 20 70 72 6f 63 65 73 | 73 20 74 68 65 20 63 6c |r proces|s the cl|
|00004370| 69 63 6b 2e 0d 20 0d 09 | 09 53 45 47 09 27 4d 61 |ick.. ..|.SEG.'Ma|
|00004380| 69 6e 27 09 09 09 3b 20 | 63 61 73 65 20 73 65 6e |in'...; |case sen|
|00004390| 73 69 74 69 76 65 0d 44 | 6f 43 6f 6e 74 65 6e 74 |sitive.D|oContent|
|000043a0| 43 6c 69 63 6b 09 50 52 | 4f 43 0d 0d 53 74 61 63 |Click.PR|OC..Stac|
|000043b0| 6b 46 72 61 6d 65 09 52 | 45 43 4f 52 44 09 7b 41 |kFrame.R|ECORD.{A|
|000043c0| 36 4c 69 6e 6b 7d 2c 44 | 45 43 52 09 09 3b 20 62 |6Link},D|ECR..; b|
|000043d0| 75 69 6c 64 20 61 20 73 | 74 61 63 6b 20 66 72 61 |uild a s|tack fra|
|000043e0| 6d 65 20 72 65 63 6f 72 | 64 0d 50 61 72 61 6d 42 |me recor|d.ParamB|
|000043f0| 65 67 69 6e 09 45 51 55 | 09 2a 09 09 09 3b 20 73 |egin.EQU|.*...; s|
|00004400| 74 61 72 74 20 70 61 72 | 61 6d 65 74 65 72 73 20 |tart par|ameters |
|00004410| 61 66 74 65 72 20 74 68 | 69 73 20 70 6f 69 6e 74 |after th|is point|
|00004420| 0d 57 69 6e 64 6f 77 50 | 74 72 09 44 53 2e 4c 09 |.WindowP|tr.DS.L.|
|00004430| 31 09 09 09 3b 20 70 61 | 73 73 65 64 20 70 61 72 |1...; pa|ssed par|
|00004440| 61 6d 65 74 65 72 20 6f | 66 20 74 68 65 20 77 69 |ameter o|f the wi|
|00004450| 6e 64 6f 77 20 70 6f 69 | 6e 74 65 72 0d 45 76 65 |ndow poi|nter.Eve|
|00004460| 6e 74 50 74 72 09 44 53 | 2e 4c 09 31 09 09 09 3b |ntPtr.DS|.L.1...;|
|00004470| 20 70 6f 69 6e 74 65 72 | 20 74 6f 20 74 68 65 20 | pointer| to the |
|00004480| 65 76 65 6e 74 20 72 65 | 63 6f 72 64 0d 50 61 72 |event re|cord.Par|
|00004490| 61 6d 53 69 7a 65 09 45 | 51 55 09 50 61 72 61 6d |amSize.E|QU.Param|
|000044a0| 42 65 67 69 6e 2d 2a 09 | 09 3b 20 73 69 7a 65 20 |Begin-*.|.; size |
|000044b0| 6f 66 20 61 6c 6c 20 74 | 68 65 20 70 61 73 73 65 |of all t|he passe|
|000044c0| 64 20 70 61 72 61 6d 65 | 74 65 72 73 0d 52 65 74 |d parame|ters.Ret|
|000044d0| 41 64 64 72 20 09 44 53 | 2e 4c 09 31 09 09 09 3b |Addr .DS|.L.1...;|
|000044e0| 20 70 6c 61 63 65 20 68 | 6f 6c 64 65 72 20 66 6f | place h|older fo|
|000044f0| 72 20 72 65 74 75 72 6e | 20 61 64 64 72 65 73 73 |r return| address|
|00004500| 0d 41 36 4c 69 6e 6b 09 | 09 44 53 2e 4c 09 31 09 |.A6Link.|.DS.L.1.|
|00004510| 09 09 3b 20 70 6c 61 63 | 65 20 68 6f 6c 64 65 72 |..; plac|e holder|
|00004520| 20 66 6f 72 20 41 36 20 | 6c 69 6e 6b 0d 4c 6f 63 | for A6 |link.Loc|
|00004530| 61 6c 53 69 7a 65 09 45 | 51 55 20 09 2a 09 09 09 |alSize.E|QU .*...|
|00004540| 3b 20 73 69 7a 65 20 6f | 66 20 61 6c 6c 20 74 68 |; size o|f all th|
|00004550| 65 20 6c 6f 63 61 6c 20 | 76 61 72 69 61 62 6c 65 |e local |variable|
|00004560| 73 0d 09 09 45 4e 44 52 | 0d 09 09 0d 09 09 49 4d |s...ENDR|......IM|
|00004570| 50 4f 52 54 09 53 65 74 | 4c 69 67 68 74 0d 0d 09 |PORT.Set|Light...|
|00004580| 09 57 49 54 48 09 53 74 | 61 63 6b 46 72 61 6d 65 |.WITH.St|ackFrame|
|00004590| 09 09 3b 20 63 6f 76 65 | 72 20 6f 75 72 20 6c 6f |..; cove|r our lo|
|000045a0| 63 61 6c 20 73 74 61 63 | 6b 20 66 72 61 6d 65 0d |cal stac|k frame.|
|000045b0| 09 09 4c 49 4e 4b 09 41 | 36 2c 23 4c 6f 63 61 6c |..LINK.A|6,#Local|
|000045c0| 53 69 7a 65 09 09 3b 20 | 61 6c 6c 6f 63 61 74 65 |Size..; |allocate|
|000045d0| 20 6f 75 72 20 6c 6f 63 | 61 6c 20 73 74 61 63 6b | our loc|al stack|
|000045e0| 20 66 72 61 6d 65 0d 0d | 20 09 09 4d 4f 56 45 2e | frame..| ..MOVE.|
|000045f0| 4c 09 57 69 6e 64 6f 77 | 50 74 72 28 41 36 29 2c |L.Window|Ptr(A6),|
|00004600| 2d 28 53 50 29 09 3b 20 | 70 61 73 73 20 74 68 65 |-(SP).; |pass the|
|00004610| 20 77 69 6e 64 6f 77 20 | 70 6f 69 6e 74 65 72 0d | window |pointer.|
|00004620| 09 09 4d 4f 56 45 2e 57 | 09 47 2e 53 74 6f 70 70 |..MOVE.W|.G.Stopp|
|00004630| 65 64 2c 44 30 09 09 3b | 20 67 65 74 20 63 75 72 |ed,D0..;| get cur|
|00004640| 72 65 6e 74 20 73 74 61 | 74 65 20 6f 66 20 74 68 |rent sta|te of th|
|00004650| 65 20 6c 69 67 68 74 0d | 09 09 45 4f 52 49 2e 57 |e light.|..EORI.W|
|00004660| 09 23 54 72 75 65 2c 44 | 30 09 09 3b 20 65 78 63 |.#True,D|0..; exc|
|00004670| 6c 75 73 69 76 65 20 4f | 52 20 74 68 65 20 63 75 |lusive O|R the cu|
|00004680| 72 72 65 6e 74 20 73 74 | 61 74 65 0d 09 09 4d 4f |rrent st|ate...MO|
|00004690| 56 45 2e 57 09 44 30 2c | 2d 28 53 50 29 09 09 3b |VE.W.D0,|-(SP)..;|
|000046a0| 20 70 61 73 73 20 6e 65 | 77 20 73 74 61 74 65 20 | pass ne|w state |
|000046b0| 74 6f 20 73 77 69 74 63 | 68 20 6c 69 67 68 74 0d |to switc|h light.|
|000046c0| 09 09 42 53 52 09 53 65 | 74 4c 69 67 68 74 09 09 |..BSR.Se|tLight..|
|000046d0| 3b 20 73 65 74 20 74 68 | 65 20 74 72 61 66 66 69 |; set th|e traffi|
|000046e0| 63 20 6c 69 67 68 74 0d | 0d 45 78 69 74 09 09 55 |c light.|.Exit..U|
|000046f0| 4e 4c 4b 09 41 36 09 09 | 09 3b 20 64 65 73 74 72 |NLK.A6..|.; destr|
|00004700| 6f 79 20 74 68 65 20 6c | 69 6e 6b 0d 09 09 4d 4f |oy the l|ink...MO|
|00004710| 56 45 41 2e 4c 09 28 53 | 50 29 2b 2c 41 30 09 09 |VEA.L.(S|P)+,A0..|
|00004720| 3b 20 70 75 6c 6c 20 6f | 66 66 20 74 68 65 20 72 |; pull o|ff the r|
|00004730| 65 74 75 72 6e 20 61 64 | 64 72 65 73 73 0d 09 09 |eturn ad|dress...|
|00004740| 41 44 44 41 2e 4c 09 23 | 50 61 72 61 6d 53 69 7a |ADDA.L.#|ParamSiz|
|00004750| 65 2c 53 50 09 09 3b 20 | 73 74 72 69 70 20 61 6c |e,SP..; |strip al|
|00004760| 6c 20 6f 66 20 74 68 65 | 20 63 61 6c 6c 65 72 27 |l of the| caller'|
|00004770| 73 20 70 61 72 61 6d 65 | 74 65 72 73 0d 09 09 4a |s parame|ters...J|
|00004780| 4d 50 09 28 41 30 29 09 | 09 09 3b 20 72 65 74 75 |MP.(A0).|..; retu|
|00004790| 72 6e 20 74 6f 20 74 68 | 65 20 63 61 6c 6c 65 72 |rn to th|e caller|
|000047a0| 0d 0d 09 09 44 62 67 49 | 6e 66 6f 09 44 6f 43 6f |....DbgI|nfo.DoCo|
|000047b0| 6e 74 6e 74 09 09 3b 20 | 74 68 69 73 20 6e 61 6d |ntnt..; |this nam|
|000047c0| 65 20 77 69 6c 6c 20 61 | 70 70 65 61 72 20 69 6e |e will a|ppear in|
|000047d0| 20 74 68 65 20 64 65 62 | 75 67 67 65 72 0d 09 09 | the deb|ugger...|
|000047e0| 45 4e 44 50 0d 0d 2a 20 | 3d 3d 3d 3d 3d 3d 3d 3d |ENDP..* |========|
|000047f0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004800| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004810| 3d 3d 3d 3d 3d 3d 3d 3d | 0d 2a 20 50 52 4f 43 45 |========|.* PROCE|
|00004820| 44 55 52 45 20 44 6f 55 | 70 64 61 74 65 28 77 69 |DURE DoU|pdate(wi|
|00004830| 6e 64 6f 77 3a 20 57 69 | 6e 64 6f 77 50 74 72 29 |ndow: Wi|ndowPtr)|
|00004840| 3b 0d 2a 20 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |;.* ====|========|
|00004850| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004860| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00004870| 3d 3d 3d 3d 0d 2a 20 54 | 68 69 73 20 69 73 20 63 |====.* T|his is c|
|00004880| 61 6c 6c 65 64 20 77 68 | 65 6e 20 61 6e 20 75 70 |alled wh|en an up|
|00004890| 64 61 74 65 20 65 76 65 | 6e 74 20 69 73 20 72 65 |date eve|nt is re|
|000048a0| 63 65 69 76 65 64 20 66 | 6f 72 20 61 20 77 69 6e |ceived f|or a win|
|000048b0| 64 6f 77 2e 0d 2a 20 49 | 74 20 63 61 6c 6c 73 20 |dow..* I|t calls |
|000048c0| 44 72 61 77 57 69 6e 64 | 6f 77 20 74 6f 20 64 72 |DrawWind|ow to dr|
|000048d0| 61 77 20 74 68 65 20 63 | 6f 6e 74 65 6e 74 73 20 |aw the c|ontents |
|000048e0| 6f 66 20 61 6e 20 61 70 | 70 6c 69 63 61 74 69 6f |of an ap|plicatio|
|000048f0| 6e 20 77 69 6e 64 6f 77 | 2e 0d 2a 20 41 73 20 61 |n window|..* As a|
|00004900| 6e 20 65 66 66 69 63 69 | 65 6e 63 79 20 6d 65 61 |n effici|ency mea|
|00004910| 73 75 72 65 20 74 68 61 | 74 20 64 6f 65 73 20 6e |sure tha|t does n|
|00004920| 6f 74 20 68 61 76 65 20 | 74 6f 20 62 65 20 66 6f |ot have |to be fo|
|00004930| 6c 6c 6f 77 65 64 2c 20 | 69 74 0d 2a 20 63 61 6c |llowed, |it.* cal|
|00004940| 6c 73 20 74 68 65 20 64 | 72 61 77 69 6e 67 20 72 |ls the d|rawing r|
|00004950| 6f 75 74 69 6e 65 20 6f | 6e 6c 79 20 69 66 20 74 |outine o|nly if t|
|00004960| 68 65 20 76 69 73 52 67 | 6e 20 69 73 20 6e 6f 6e |he visRg|n is non|
|00004970| 2d 65 6d 70 74 79 2e 20 | 54 68 69 73 0d 2a 20 77 |-empty. |This.* w|
|00004980| 69 6c 6c 20 68 61 6e 64 | 6c 65 20 73 69 74 75 61 |ill hand|le situa|
|00004990| 74 69 6f 6e 73 20 77 68 | 65 72 65 20 63 61 6c 63 |tions wh|ere calc|
|000049a0| 75 6c 61 74 69 6f 6e 73 | 20 66 6f 72 20 64 72 61 |ulations| for dra|
|000049b0| 77 69 6e 67 20 6f 72 20 | 64 72 61 77 69 6e 67 0d |wing or |drawing.|
|000049c0| 2a 20 69 74 73 65 6c 66 | 20 69 73 20 76 65 72 79 |* itself| is very|
|000049d0| 20 74 69 6d 65 2d 63 6f | 6e 73 75 6d 69 6e 67 2e | time-co|nsuming.|
|000049e0| 0d 0d 09 09 53 45 47 09 | 27 4d 61 69 6e 27 09 09 |....SEG.|'Main'..|
|000049f0| 09 3b 20 63 61 73 65 20 | 73 65 6e 73 69 74 69 76 |.; case |sensitiv|
|00004a00| 65 0d 44 6f 55 70 64 61 | 74 65 09 50 52 4f 43 0d |e.DoUpda|te.PROC.|
|00004a10| 0d 53 74 61 63 6b 46 72 | 61 6d 65 09 52 45 43 4f |.StackFr|ame.RECO|
|00004a20| 52 44 09 7b 41 36 4c 69 | 6e 6b 7d 2c 44 45 43 52 |RD.{A6Li|nk},DECR|
|00004a30| 09 09 3b 20 62 75 69 6c | 64 20 61 20 73 74 61 63 |..; buil|d a stac|
|00004a40| 6b 20 66 72 61 6d 65 20 | 72 65 63 6f 72 64 0d 50 |k frame |record.P|
|00004a50| 61 72 61 6d 42 65 67 69 | 6e 09 45 51 55 09 2a 09 |aramBegi|n.EQU.*.|
|00004a60| 09 09 3b 20 73 74 61 72 | 74 20 70 61 72 61 6d 65 |..; star|t parame|
|00004a70| 74 65 72 73 20 61 66 74 | 65 72 20 74 68 69 73 20 |ters aft|er this |
|00004a80| 70 6f 69 6e 74 0d 57 69 | 6e 64 6f 77 50 74 72 09 |point.Wi|ndowPtr.|
|00004a90| 44 53 2e 4c 09 31 09 09 | 09 3b 20 70 61 73 73 65 |DS.L.1..|.; passe|
|00004aa0| 64 20 70 61 72 61 6d 65 | 74 65 72 20 6f 66 20 74 |d parame|ter of t|
|00004ab0| 68 65 20 77 69 6e 64 6f | 77 20 70 6f 69 6e 74 65 |he windo|w pointe|
|00004ac0| 72 0d 50 61 72 61 6d 53 | 69 7a 65 09 45 51 55 09 |r.ParamS|ize.EQU.|
|00004ad0| 50 61 72 61 6d 42 65 67 | 69 6e 2d 2a 09 09 3b 20 |ParamBeg|in-*..; |
|00004ae0| 73 69 7a 65 20 6f 66 20 | 61 6c 6c 20 74 68 65 20 |size of |all the |
|00004af0| 70 61 73 73 65 64 20 70 | 61 72 61 6d 65 74 65 72 |passed p|arameter|
|00004b00| 73 0d 52 65 74 41 64 64 | 72 20 09 44 53 2e 4c 09 |s.RetAdd|r .DS.L.|
|00004b10| 31 09 09 09 3b 20 70 6c | 61 63 65 20 68 6f 6c 64 |1...; pl|ace hold|
|00004b20| 65 72 20 66 6f 72 20 72 | 65 74 75 72 6e 20 61 64 |er for r|eturn ad|
|00004b30| 64 72 65 73 73 0d 41 36 | 4c 69 6e 6b 09 09 44 53 |dress.A6|Link..DS|
|00004b40| 2e 4c 09 31 09 09 09 3b | 20 70 6c 61 63 65 20 68 |.L.1...;| place h|
|00004b50| 6f 6c 64 65 72 20 66 6f | 72 20 41 36 20 6c 69 6e |older fo|r A6 lin|
|00004b60| 6b 0d 4c 6f 63 61 6c 53 | 69 7a 65 09 45 51 55 20 |k.LocalS|ize.EQU |
|00004b70| 09 2a 09 09 09 3b 20 73 | 69 7a 65 20 6f 66 20 61 |.*...; s|ize of a|
|00004b80| 6c 6c 20 74 68 65 20 6c | 6f 63 61 6c 20 76 61 72 |ll the l|ocal var|
|00004b90| 69 61 62 6c 65 73 0d 09 | 09 45 4e 44 52 0d 09 09 |iables..|.ENDR...|
|00004ba0| 0d 09 09 49 4d 50 4f 52 | 54 09 49 73 41 70 70 57 |...IMPOR|T.IsAppW|
|00004bb0| 69 6e 64 6f 77 2c 44 72 | 61 77 57 69 6e 64 6f 77 |indow,Dr|awWindow|
|00004bc0| 0d 0d 09 09 57 49 54 48 | 09 53 74 61 63 6b 46 72 |....WITH|.StackFr|
|00004bd0| 61 6d 65 09 09 3b 20 63 | 6f 76 65 72 20 6f 75 72 |ame..; c|over our|
|00004be0| 20 6c 6f 63 61 6c 20 73 | 74 61 63 6b 20 66 72 61 | local s|tack fra|
|00004bf0| 6d 65 0d 09 09 4c 49 4e | 4b 09 41 36 2c 23 4c 6f |me...LIN|K.A6,#Lo|
|00004c00| 63 61 6c 53 69 7a 65 09 | 09 3b 20 61 6c 6c 6f 63 |calSize.|.; alloc|
|00004c10| 61 74 65 20 6f 75 72 20 | 6c 6f 63 61 6c 20 73 74 |ate our |local st|
|00004c20| 61 63 6b 20 66 72 61 6d | 65 0d 0d 09 09 43 4c 52 |ack fram|e....CLR|
|00004c30| 2e 57 09 2d 28 53 50 29 | 09 09 09 3b 20 73 70 61 |.W.-(SP)|...; spa|
|00004c40| 63 65 20 66 6f 72 20 72 | 65 73 75 6c 74 20 6f 66 |ce for r|esult of|
|00004c50| 20 49 73 41 70 70 57 69 | 6e 64 6f 77 0d 09 09 4d | IsAppWi|ndow...M|
|00004c60| 4f 56 45 2e 4c 09 57 69 | 6e 64 6f 77 50 74 72 28 |OVE.L.Wi|ndowPtr(|
|00004c70| 41 36 29 2c 2d 28 53 50 | 29 09 3b 20 70 61 73 73 |A6),-(SP|).; pass|
|00004c80| 20 74 68 65 20 77 69 6e | 64 6f 77 20 70 6f 69 6e | the win|dow poin|
|00004c90| 74 65 72 0d 09 09 42 53 | 52 09 49 73 41 70 70 57 |ter...BS|R.IsAppW|
|00004ca0| 69 6e 64 6f 77 09 09 3b | 20 74 65 73 74 20 69 66 |indow..;| test if|
|00004cb0| 20 74 68 69 73 20 77 69 | 6e 64 6f 77 20 77 61 73 | this wi|ndow was|
|00004cc0| 20 6f 75 72 73 0d 09 09 | 4d 4f 56 45 2e 57 09 28 | ours...|MOVE.W.(|
|00004cd0| 53 50 29 2b 2c 44 30 09 | 09 0d 09 09 43 4d 50 49 |SP)+,D0.|....CMPI|
|00004ce0| 2e 57 09 23 54 72 75 65 | 2c 44 30 09 09 3b 20 69 |.W.#True|,D0..; i|
|00004cf0| 74 20 6d 75 73 74 20 62 | 65 20 6f 75 72 20 77 69 |t must b|e our wi|
|00004d00| 6e 64 6f 77 0d 09 09 42 | 4e 45 2e 53 09 45 78 69 |ndow...B|NE.S.Exi|
|00004d10| 74 09 09 09 3b 20 69 74 | 20 77 61 73 6e 27 74 20 |t...; it| wasn't |
|00004d20| 6f 75 72 20 77 69 6e 64 | 6f 77 0d 09 09 0d 09 09 |our wind|ow......|
|00004d30| 4d 4f 56 45 2e 4c 09 57 | 69 6e 64 6f 77 50 74 72 |MOVE.L.W|indowPtr|
|00004d40| 28 41 36 29 2c 2d 28 53 | 50 29 09 3b 20 75 70 64 |(A6),-(S|P).; upd|
|00004d50| 61 74 65 20 6f 6e 6c 79 | 20 74 68 65 20 76 69 73 |ate only| the vis|
|00004d60| 69 62 6c 65 20 72 65 67 | 69 6f 6e 0d 09 09 5f 42 |ible reg|ion..._B|
|00004d70| 65 67 69 6e 55 70 44 61 | 74 65 09 09 09 3b 20 72 |eginUpDa|te...; r|
|00004d80| 65 67 69 6f 6e 20 6f 66 | 20 74 68 65 20 77 69 6e |egion of| the win|
|00004d90| 64 6f 77 0d 09 09 43 4c | 52 2e 57 09 2d 28 53 50 |dow...CL|R.W.-(SP|
|00004da0| 29 09 09 09 3b 20 73 70 | 61 63 65 20 66 6f 72 20 |)...; sp|ace for |
|00004db0| 72 65 73 75 6c 74 0d 09 | 09 4d 4f 56 45 41 2e 4c |result..|.MOVEA.L|
|00004dc0| 09 57 69 6e 64 6f 77 50 | 74 72 28 41 36 29 2c 41 |.WindowP|tr(A6),A|
|00004dd0| 30 09 3b 20 74 68 65 20 | 77 69 6e 64 6f 77 20 70 |0.; the |window p|
|00004de0| 6f 69 6e 74 65 72 0d 09 | 09 4d 4f 56 45 2e 4c 09 |ointer..|.MOVE.L.|
|00004df0| 76 69 73 52 67 6e 28 41 | 30 29 2c 2d 28 53 50 29 |visRgn(A|0),-(SP)|
|00004e00| 09 3b 20 74 68 65 20 77 | 69 6e 64 6f 77 27 73 20 |.; the w|indow's |
|00004e10| 76 69 73 52 67 6e 20 68 | 61 6e 64 6c 65 0d 09 09 |visRgn h|andle...|
|00004e20| 5f 45 6d 70 74 79 52 67 | 6e 0d 09 09 4d 4f 56 45 |_EmptyRg|n...MOVE|
|00004e30| 2e 57 09 28 53 50 29 2b | 2c 44 30 09 09 3b 20 72 |.W.(SP)+|,D0..; r|
|00004e40| 65 73 75 6c 74 20 6f 66 | 20 45 6d 70 74 79 52 67 |esult of| EmptyRg|
|00004e50| 6e 0d 09 09 43 4d 50 49 | 2e 57 09 23 54 72 75 65 |n...CMPI|.W.#True|
|00004e60| 2c 44 30 09 09 3b 20 77 | 61 73 20 74 68 65 20 76 |,D0..; w|as the v|
|00004e70| 69 73 52 67 6e 20 65 6d | 70 74 79 3f 0d 09 09 42 |isRgn em|pty?...B|
|00004e80| 45 51 2e 53 09 40 31 09 | 09 09 3b 20 79 65 73 2c |EQ.S.@1.|..; yes,|
|00004e90| 20 74 68 65 6e 20 6e 6f | 20 75 70 64 61 74 65 20 | then no| update |
|00004ea0| 69 73 20 6e 65 65 64 65 | 64 0d 09 09 0d 09 09 4d |is neede|d......M|
|00004eb0| 4f 56 45 2e 4c 09 57 69 | 6e 64 6f 77 50 74 72 28 |OVE.L.Wi|ndowPtr(|
|00004ec0| 41 36 29 2c 2d 28 53 50 | 29 0d 09 09 42 53 52 09 |A6),-(SP|)...BSR.|
|00004ed0| 44 72 61 77 57 69 6e 64 | 6f 77 09 09 3b 20 64 72 |DrawWind|ow..; dr|
|00004ee0| 61 77 20 74 68 65 20 74 | 72 61 66 66 69 63 20 6c |aw the t|raffic l|
|00004ef0| 69 67 68 74 73 0d 09 09 | 0d 40 31 09 09 4d 4f 56 |ights...|.@1..MOV|
|00004f00| 45 2e 4c 09 57 69 6e 64 | 6f 77 50 74 72 28 41 36 |E.L.Wind|owPtr(A6|
|00004f10| 29 2c 2d 28 53 50 29 09 | 3b 20 67 65 74 20 70 6f |),-(SP).|; get po|
|00004f20| 69 6e 74 65 72 20 74 6f | 20 77 69 6e 64 6f 77 0d |inter to| window.|
|00004f30| 09 09 5f 45 6e 64 55 70 | 64 61 74 65 0d 0d 45 78 |.._EndUp|date..Ex|
|00004f40| 69 74 09 09 55 4e 4c 4b | 09 41 36 09 09 09 3b 20 |it..UNLK|.A6...; |
|00004f50| 64 65 73 74 72 6f 79 20 | 74 68 65 20 6c 69 6e 6b |destroy |the link|
|00004f60| 0d 09 09 4d 4f 56 45 41 | 2e 4c 09 28 53 50 29 2b |...MOVEA|.L.(SP)+|
|00004f70| 2c 41 30 09 09 3b 20 70 | 75 6c 6c 20 6f 66 66 20 |,A0..; p|ull off |
|00004f80| 74 68 65 20 72 65 74 75 | 72 6e 20 61 64 64 72 65 |the retu|rn addre|
|00004f90| 73 73 0d 09 09 41 44 44 | 41 2e 4c 09 23 50 61 72 |ss...ADD|A.L.#Par|
|00004fa0| 61 6d 53 69 7a 65 2c 53 | 50 09 09 3b 20 73 74 72 |amSize,S|P..; str|
|00004fb0| 69 70 20 61 6c 6c 20 6f | 66 20 74 68 65 20 63 61 |ip all o|f the ca|
|00004fc0| 6c 6c 65 72 27 73 20 70 | 61 72 61 6d 65 74 65 72 |ller's p|arameter|
|00004fd0| 73 0d 09 09 4a 4d 50 09 | 28 41 30 29 09 09 09 3b |s...JMP.|(A0)...;|
|00004fe0| 20 72 65 74 75 72 6e 20 | 74 6f 20 74 68 65 20 63 | return |to the c|
|00004ff0| 61 6c 6c 65 72 0d 0d 09 | 09 44 62 67 49 6e 66 6f |aller...|.DbgInfo|
|00005000| 09 44 6f 55 70 64 61 74 | 65 09 09 3b 20 74 68 69 |.DoUpdat|e..; thi|
|00005010| 73 20 6e 61 6d 65 20 77 | 69 6c 6c 20 61 70 70 65 |s name w|ill appe|
|00005020| 61 72 20 69 6e 20 74 68 | 65 20 64 65 62 75 67 67 |ar in th|e debugg|
|00005030| 65 72 0d 09 09 45 4e 44 | 50 0d 0d 2a 20 3d 3d 3d |er...END|P..* ===|
|00005040| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00005050| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00005060| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 0d 2a 20 |========|=====.* |
|00005070| 50 52 4f 43 45 44 55 52 | 45 20 44 6f 41 63 74 69 |PROCEDUR|E DoActi|
|00005080| 76 61 74 65 28 77 69 6e | 64 6f 77 3a 20 57 69 6e |vate(win|dow: Win|
|00005090| 64 6f 77 50 74 72 3b 20 | 62 65 63 6f 6d 69 6e 67 |dowPtr; |becoming|
|000050a0| 41 63 74 69 76 65 3a 20 | 42 4f 4f 4c 45 41 4e 29 |Active: |BOOLEAN)|
|000050b0| 3b 0d 2a 20 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |;.* ====|========|
|000050c0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000050d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000050e0| 3d 3d 3d 3d 0d 2a 20 49 | 6e 20 74 68 69 73 20 73 |====.* I|n this s|
|000050f0| 61 6d 70 6c 65 20 74 68 | 65 72 65 20 69 73 20 6e |ample th|ere is n|
|00005100| 6f 20 6f 74 68 65 72 20 | 70 72 6f 63 65 73 73 69 |o other |processi|
|00005110| 6e 67 20 6e 65 63 65 73 | 73 61 72 79 20 6f 74 68 |ng neces|sary oth|
|00005120| 65 72 20 74 68 61 6e 20 | 77 68 61 74 0d 2a 20 74 |er than |what.* t|
|00005130| 68 65 20 57 69 6e 64 6f | 77 20 4d 61 6e 61 67 65 |he Windo|w Manage|
|00005140| 72 20 68 61 73 20 61 6c | 72 65 61 64 79 20 64 6f |r has al|ready do|
|00005150| 6e 65 20 66 6f 72 20 75 | 73 2e 20 20 54 68 69 73 |ne for u|s. This|
|00005160| 20 77 6f 75 6c 64 20 62 | 65 20 74 68 65 20 70 6c | would b|e the pl|
|00005170| 61 63 65 20 74 6f 0d 2a | 20 70 65 72 66 6f 72 6d |ace to.*| perform|
|00005180| 20 61 6e 20 61 63 74 69 | 76 61 74 65 20 6f 6e 20 | an acti|vate on |
|00005190| 54 65 78 74 45 64 69 74 | 20 72 65 63 6f 72 64 73 |TextEdit| records|
|000051a0| 2c 20 63 6f 6e 74 72 6f | 6c 73 2c 20 6c 69 73 74 |, contro|ls, list|
|000051b0| 73 2c 20 75 70 64 61 74 | 65 20 47 72 6f 77 49 63 |s, updat|e GrowIc|
|000051c0| 6f 6e 2c 20 65 74 63 2e | 0d 0d 09 09 53 45 47 09 |on, etc.|....SEG.|
|000051d0| 27 4d 61 69 6e 27 09 09 | 09 3b 20 63 61 73 65 20 |'Main'..|.; case |
|000051e0| 73 65 6e 73 69 74 69 76 | 65 0d 44 6f 41 63 74 69 |sensitiv|e.DoActi|
|000051f0| 76 61 74 65 09 50 52 4f | 43 0d 0d 53 74 61 63 6b |vate.PRO|C..Stack|
|00005200| 46 72 61 6d 65 09 52 45 | 43 4f 52 44 09 7b 41 36 |Frame.RE|CORD.{A6|
|00005210| 4c 69 6e 6b 7d 2c 44 45 | 43 52 09 09 3b 20 62 75 |Link},DE|CR..; bu|
|00005220| 69 6c 64 20 61 20 73 74 | 61 63 6b 20 66 72 61 6d |ild a st|ack fram|
|00005230| 65 20 72 65 63 6f 72 64 | 0d 50 61 72 61 6d 42 65 |e record|.ParamBe|
|00005240| 67 69 6e 09 45 51 55 09 | 2a 09 09 09 3b 20 73 74 |gin.EQU.|*...; st|
|00005250| 61 72 74 20 70 61 72 61 | 6d 65 74 65 72 73 20 61 |art para|meters a|
|00005260| 66 74 65 72 20 74 68 69 | 73 20 70 6f 69 6e 74 0d |fter thi|s point.|
|00005270| 57 69 6e 64 6f 77 50 74 | 72 09 44 53 2e 4c 09 31 |WindowPt|r.DS.L.1|
|00005280| 09 09 09 3b 20 70 61 73 | 73 65 64 20 70 61 72 61 |...; pas|sed para|
|00005290| 6d 65 74 65 72 20 6f 66 | 20 74 68 65 20 77 69 6e |meter of| the win|
|000052a0| 64 6f 77 20 70 6f 69 6e | 74 65 72 0d 41 63 74 69 |dow poin|ter.Acti|
|000052b0| 76 65 09 09 44 53 2e 57 | 09 31 09 09 09 3b 20 6d |ve..DS.W|.1...; m|
|000052c0| 6f 64 69 66 69 65 72 73 | 20 66 72 6f 6d 20 74 68 |odifiers| from th|
|000052d0| 65 20 65 76 65 6e 74 20 | 72 65 63 6f 72 64 0d 50 |e event |record.P|
|000052e0| 61 72 61 6d 53 69 7a 65 | 09 45 51 55 09 50 61 72 |aramSize|.EQU.Par|
|000052f0| 61 6d 42 65 67 69 6e 2d | 2a 09 09 3b 20 73 69 7a |amBegin-|*..; siz|
|00005300| 65 20 6f 66 20 61 6c 6c | 20 74 68 65 20 70 61 73 |e of all| the pas|
|00005310| 73 65 64 20 70 61 72 61 | 6d 65 74 65 72 73 0d 52 |sed para|meters.R|
|00005320| 65 74 41 64 64 72 20 09 | 44 53 2e 4c 09 31 09 09 |etAddr .|DS.L.1..|
|00005330| 09 3b 20 70 6c 61 63 65 | 20 68 6f 6c 64 65 72 20 |.; place| holder |
|00005340| 66 6f 72 20 72 65 74 75 | 72 6e 20 61 64 64 72 65 |for retu|rn addre|
|00005350| 73 73 0d 41 36 4c 69 6e | 6b 09 09 44 53 2e 4c 09 |ss.A6Lin|k..DS.L.|
|00005360| 31 09 09 09 3b 20 70 6c | 61 63 65 20 68 6f 6c 64 |1...; pl|ace hold|
|00005370| 65 72 20 66 6f 72 20 41 | 36 20 6c 69 6e 6b 0d 4c |er for A|6 link.L|
|00005380| 6f 63 61 6c 53 69 7a 65 | 09 45 51 55 20 09 2a 09 |ocalSize|.EQU .*.|
|00005390| 09 09 3b 20 73 69 7a 65 | 20 6f 66 20 61 6c 6c 20 |..; size| of all |
|000053a0| 74 68 65 20 6c 6f 63 61 | 6c 20 76 61 72 69 61 62 |the loca|l variab|
|000053b0| 6c 65 73 0d 09 09 45 4e | 44 52 0d 09 09 0d 09 09 |les...EN|DR......|
|000053c0| 49 4d 50 4f 52 54 09 49 | 73 41 70 70 57 69 6e 64 |IMPORT.I|sAppWind|
|000053d0| 6f 77 0d 0d 09 09 57 49 | 54 48 09 53 74 61 63 6b |ow....WI|TH.Stack|
|000053e0| 46 72 61 6d 65 09 09 3b | 20 63 6f 76 65 72 20 6f |Frame..;| cover o|
|000053f0| 75 72 20 6c 6f 63 61 6c | 20 73 74 61 63 6b 20 66 |ur local| stack f|
|00005400| 72 61 6d 65 0d 09 09 4c | 49 4e 4b 09 41 36 2c 23 |rame...L|INK.A6,#|
|00005410| 4c 6f 63 61 6c 53 69 7a | 65 09 09 3b 20 61 6c 6c |LocalSiz|e..; all|
|00005420| 6f 63 61 74 65 20 6f 75 | 72 20 6c 6f 63 61 6c 20 |ocate ou|r local |
|00005430| 73 74 61 63 6b 20 66 72 | 61 6d 65 0d 0d 09 09 43 |stack fr|ame....C|
|00005440| 4c 52 2e 57 09 2d 28 53 | 50 29 09 09 09 3b 20 73 |LR.W.-(S|P)...; s|
|00005450| 70 61 63 65 20 66 6f 72 | 20 72 65 73 75 6c 74 20 |pace for| result |
|00005460| 6f 66 20 49 73 41 70 70 | 57 69 6e 64 6f 77 0d 09 |of IsApp|Window..|
|00005470| 09 4d 4f 56 45 2e 4c 09 | 57 69 6e 64 6f 77 50 74 |.MOVE.L.|WindowPt|
|00005480| 72 28 41 36 29 2c 2d 28 | 53 50 29 09 3b 20 70 61 |r(A6),-(|SP).; pa|
|00005490| 73 73 20 74 68 65 20 77 | 69 6e 64 6f 77 20 70 6f |ss the w|indow po|
|000054a0| 69 6e 74 65 72 0d 09 09 | 42 53 52 09 49 73 41 70 |inter...|BSR.IsAp|
|000054b0| 70 57 69 6e 64 6f 77 09 | 09 3b 20 74 65 73 74 20 |pWindow.|.; test |
|000054c0| 69 66 20 74 68 69 73 20 | 77 69 6e 64 6f 77 20 77 |if this |window w|
|000054d0| 61 73 20 6f 75 72 73 0d | 09 09 4d 4f 56 45 2e 57 |as ours.|..MOVE.W|
|000054e0| 09 28 53 50 29 2b 2c 44 | 30 09 09 3b 20 67 65 74 |.(SP)+,D|0..; get|
|000054f0| 20 74 68 65 20 72 65 73 | 75 6c 74 0d 09 09 43 4d | the res|ult...CM|
|00005500| 50 49 2e 57 09 23 54 72 | 75 65 2c 44 30 09 09 3b |PI.W.#Tr|ue,D0..;|
|00005510| 20 69 74 20 6d 75 73 74 | 20 62 65 20 6f 75 72 20 | it must| be our |
|00005520| 77 69 6e 64 6f 77 0d 09 | 09 42 4e 45 2e 53 09 45 |window..|.BNE.S.E|
|00005530| 78 69 74 09 09 09 3b 20 | 69 74 20 77 61 73 6e 27 |xit...; |it wasn'|
|00005540| 74 20 6f 75 72 20 77 69 | 6e 64 6f 77 0d 0d 09 09 |t our wi|ndow....|
|00005550| 43 4d 50 49 2e 57 09 23 | 54 72 75 65 2c 41 63 74 |CMPI.W.#|True,Act|
|00005560| 69 76 65 28 41 36 29 09 | 3b 20 77 61 73 20 69 74 |ive(A6).|; was it|
|00005570| 20 61 6e 20 41 63 74 69 | 76 61 74 65 3f 0d 09 09 | an Acti|vate?...|
|00005580| 42 4e 45 2e 53 09 44 65 | 41 63 74 69 76 61 74 65 |BNE.S.De|Activate|
|00005590| 09 09 3b 20 6e 6f 2c 20 | 70 65 72 66 6f 72 6d 20 |..; no, |perform |
|000055a0| 61 20 44 65 61 63 74 69 | 76 61 74 65 0d 09 09 0d |a Deacti|vate....|
|000055b0| 2a 20 64 6f 20 74 68 65 | 20 61 63 74 69 76 61 74 |* do the| activat|
|000055c0| 65 20 65 76 65 6e 74 20 | 70 72 6f 63 65 73 73 69 |e event |processi|
|000055d0| 6e 67 20 68 65 72 65 2c | 20 74 68 65 6e 20 22 42 |ng here,| then "B|
|000055e0| 52 41 2e 53 20 20 20 45 | 78 69 74 22 0d 09 09 0d |RA.S E|xit"....|
|000055f0| 44 65 41 63 74 69 76 61 | 74 65 09 09 09 09 09 3b |DeActiva|te.....;|
|00005600| 20 64 6f 20 74 68 65 20 | 64 65 61 63 74 69 76 61 | do the |deactiva|
|00005610| 74 65 20 65 76 65 6e 74 | 0d 0d 2a 20 64 6f 20 74 |te event|..* do t|
|00005620| 68 65 20 64 65 61 63 74 | 69 76 61 74 65 20 65 76 |he deact|ivate ev|
|00005630| 65 6e 74 20 70 72 6f 63 | 65 73 73 69 6e 67 20 68 |ent proc|essing h|
|00005640| 65 72 65 2c 20 74 68 65 | 6e 20 66 61 6c 6c 20 74 |ere, the|n fall t|
|00005650| 68 72 6f 75 67 68 20 74 | 6f 20 45 78 69 74 0d 09 |hrough t|o Exit..|
|00005660| 09 0d 0d 45 78 69 74 09 | 09 55 4e 4c 4b 09 41 36 |...Exit.|.UNLK.A6|
|00005670| 09 09 09 3b 20 64 65 73 | 74 72 6f 79 20 74 68 65 |...; des|troy the|
|00005680| 20 6c 69 6e 6b 0d 09 09 | 4d 4f 56 45 41 2e 4c 09 | link...|MOVEA.L.|
|00005690| 28 53 50 29 2b 2c 41 30 | 09 09 3b 20 70 75 6c 6c |(SP)+,A0|..; pull|
|000056a0| 20 6f 66 66 20 74 68 65 | 20 72 65 74 75 72 6e 20 | off the| return |
|000056b0| 61 64 64 72 65 73 73 0d | 09 09 41 44 44 41 2e 4c |address.|..ADDA.L|
|000056c0| 09 23 50 61 72 61 6d 53 | 69 7a 65 2c 53 50 09 09 |.#ParamS|ize,SP..|
|000056d0| 3b 20 73 74 72 69 70 20 | 61 6c 6c 20 6f 66 20 74 |; strip |all of t|
|000056e0| 68 65 20 63 61 6c 6c 65 | 72 27 73 20 70 61 72 61 |he calle|r's para|
|000056f0| 6d 65 74 65 72 73 0d 09 | 09 4a 4d 50 09 28 41 30 |meters..|.JMP.(A0|
|00005700| 29 09 09 09 3b 20 72 65 | 74 75 72 6e 20 74 6f 20 |)...; re|turn to |
|00005710| 74 68 65 20 63 61 6c 6c | 65 72 0d 0d 09 09 44 62 |the call|er....Db|
|00005720| 67 49 6e 66 6f 09 41 63 | 74 69 76 61 74 65 09 09 |gInfo.Ac|tivate..|
|00005730| 3b 20 74 68 69 73 20 6e | 61 6d 65 20 77 69 6c 6c |; this n|ame will|
|00005740| 20 61 70 70 65 61 72 20 | 69 6e 20 74 68 65 20 64 | appear |in the d|
|00005750| 65 62 75 67 67 65 72 0d | 09 09 45 4e 44 50 0d 09 |ebugger.|..ENDP..|
|00005760| 09 09 09 09 0d 2a 20 3d | 3d 3d 3d 3d 3d 3d 3d 3d |.....* =|========|
|00005770| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00005780| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00005790| 3d 3d 3d 3d 3d 3d 3d 0d | 2a 20 50 52 4f 43 45 44 |=======.|* PROCED|
|000057a0| 55 52 45 20 44 6f 4d 65 | 6e 75 43 6f 6d 6d 61 6e |URE DoMe|nuComman|
|000057b0| 64 28 6d 65 6e 75 52 65 | 73 75 6c 74 3a 20 4c 4f |d(menuRe|sult: LO|
|000057c0| 4e 47 49 4e 54 29 3b 0d | 2a 20 3d 3d 3d 3d 3d 3d |NGINT);.|* ======|
|000057d0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000057e0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000057f0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 0d 2a 20 54 68 69 |========|==.* Thi|
|00005800| 73 20 69 73 20 63 61 6c | 6c 65 64 20 77 68 65 6e |s is cal|led when|
|00005810| 20 61 6e 20 69 74 65 6d | 20 69 73 20 63 68 6f 73 | an item| is chos|
|00005820| 65 6e 20 66 72 6f 6d 20 | 74 68 65 20 6d 65 6e 75 |en from |the menu|
|00005830| 20 62 61 72 20 28 61 66 | 74 65 72 20 63 61 6c 6c | bar (af|ter call|
|00005840| 69 6e 67 0d 2a 20 4d 65 | 6e 75 53 65 6c 65 63 74 |ing.* Me|nuSelect|
|00005850| 20 6f 72 20 4d 65 6e 75 | 4b 65 79 29 2e 20 49 74 | or Menu|Key). It|
|00005860| 20 70 65 72 66 6f 72 6d | 73 20 74 68 65 20 72 69 | perform|s the ri|
|00005870| 67 68 74 20 6f 70 65 72 | 61 74 69 6f 6e 20 66 6f |ght oper|ation fo|
|00005880| 72 20 65 61 63 68 20 63 | 6f 6d 6d 61 6e 64 2e 0d |r each c|ommand..|
|00005890| 2a 20 49 74 20 69 73 20 | 67 6f 6f 64 20 74 6f 20 |* It is |good to |
|000058a0| 68 61 76 65 20 62 6f 74 | 68 20 74 68 65 20 72 65 |have bot|h the re|
|000058b0| 73 75 6c 74 20 6f 66 20 | 4d 65 6e 75 53 65 6c 65 |sult of |MenuSele|
|000058c0| 63 74 20 61 6e 64 20 4d | 65 6e 75 4b 65 79 20 67 |ct and M|enuKey g|
|000058d0| 6f 20 74 6f 0d 2a 20 6f | 6e 65 20 72 6f 75 74 69 |o to.* o|ne routi|
|000058e0| 6e 65 20 6c 69 6b 65 20 | 74 68 69 73 20 74 6f 20 |ne like |this to |
|000058f0| 6b 65 65 70 20 65 76 65 | 72 79 74 68 69 6e 67 20 |keep eve|rything |
|00005900| 6f 72 67 61 6e 69 7a 65 | 64 2e 0d 0d 09 09 53 45 |organize|d.....SE|
|00005910| 47 09 27 4d 61 69 6e 27 | 09 09 09 3b 20 63 61 73 |G.'Main'|...; cas|
|00005920| 65 20 73 65 6e 73 69 74 | 69 76 65 0d 44 6f 4d 65 |e sensit|ive.DoMe|
|00005930| 6e 75 43 6f 6d 6d 61 6e | 64 09 50 52 4f 43 0d 0d |nuComman|d.PROC..|
|00005940| 53 74 61 63 6b 46 72 61 | 6d 65 09 52 45 43 4f 52 |StackFra|me.RECOR|
|00005950| 44 09 7b 41 36 4c 69 6e | 6b 7d 2c 44 45 43 52 09 |D.{A6Lin|k},DECR.|
|00005960| 09 3b 20 62 75 69 6c 64 | 20 61 20 73 74 61 63 6b |.; build| a stack|
|00005970| 20 66 72 61 6d 65 20 72 | 65 63 6f 72 64 0d 50 61 | frame r|ecord.Pa|
|00005980| 72 61 6d 42 65 67 69 6e | 09 45 51 55 09 2a 09 09 |ramBegin|.EQU.*..|
|00005990| 09 3b 20 73 74 61 72 74 | 20 70 61 72 61 6d 65 74 |.; start| paramet|
|000059a0| 65 72 73 20 61 66 74 65 | 72 20 74 68 69 73 20 70 |ers afte|r this p|
|000059b0| 6f 69 6e 74 0d 4d 65 6e | 75 49 74 65 6d 09 44 53 |oint.Men|uItem.DS|
|000059c0| 2e 57 09 31 09 09 09 3b | 20 72 65 73 75 6c 74 20 |.W.1...;| result |
|000059d0| 66 72 6f 6d 20 5f 4d 65 | 6e 75 4b 65 79 20 6f 72 |from _Me|nuKey or|
|000059e0| 20 5f 4d 65 6e 75 53 65 | 6c 65 63 74 0d 4d 65 6e | _MenuSe|lect.Men|
|000059f0| 75 49 44 09 09 44 53 2e | 57 09 31 09 09 09 3b 20 |uID..DS.|W.1...; |
|00005a00| 63 61 6c 6c 65 72 20 70 | 61 73 73 65 64 20 61 20 |caller p|assed a |
|00005a10| 6c 6f 6e 67 20 77 6f 72 | 64 2c 20 49 44 20 2b 20 |long wor|d, ID + |
|00005a20| 49 74 65 6d 0d 50 61 72 | 61 6d 53 69 7a 65 09 45 |Item.Par|amSize.E|
|00005a30| 51 55 09 50 61 72 61 6d | 42 65 67 69 6e 2d 2a 09 |QU.Param|Begin-*.|
|00005a40| 09 3b 20 73 69 7a 65 20 | 6f 66 20 61 6c 6c 20 74 |.; size |of all t|
|00005a50| 68 65 20 70 61 73 73 65 | 64 20 70 61 72 61 6d 65 |he passe|d parame|
|00005a60| 74 65 72 73 0d 52 65 74 | 41 64 64 72 20 09 44 53 |ters.Ret|Addr .DS|
|00005a70| 2e 4c 09 31 09 09 09 3b | 20 70 6c 61 63 65 20 68 |.L.1...;| place h|
|00005a80| 6f 6c 64 65 72 20 66 6f | 72 20 72 65 74 75 72 6e |older fo|r return|
|00005a90| 20 61 64 64 72 65 73 73 | 0d 41 36 4c 69 6e 6b 09 | address|.A6Link.|
|00005aa0| 09 44 53 2e 4c 09 31 09 | 09 09 3b 20 70 6c 61 63 |.DS.L.1.|..; plac|
|00005ab0| 65 20 68 6f 6c 64 65 72 | 20 66 6f 72 20 41 36 20 |e holder| for A6 |
|00005ac0| 6c 69 6e 6b 0d 44 65 73 | 6b 6e 61 6d 65 09 44 53 |link.Des|kname.DS|
|00005ad0| 2e 42 09 32 35 36 09 09 | 09 3b 20 6c 6f 63 61 6c |.B.256..|.; local|
|00005ae0| 20 73 74 6f 72 61 67 65 | 20 66 6f 72 20 44 65 73 | storage| for Des|
|00005af0| 6b 20 41 63 63 73 20 6e | 61 6d 65 0d 54 65 6d 70 |k Accs n|ame.Temp|
|00005b00| 50 6f 72 74 09 44 53 2e | 4c 09 31 09 09 09 3b 20 |Port.DS.|L.1...; |
|00005b10| 6c 6f 63 61 6c 20 73 74 | 6f 72 61 67 65 20 66 6f |local st|orage fo|
|00005b20| 72 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 70 6f |r the cu|rrent po|
|00005b30| 72 74 0d 4c 6f 63 61 6c | 53 69 7a 65 09 45 51 55 |rt.Local|Size.EQU|
|00005b40| 20 09 2a 09 09 09 3b 20 | 73 69 7a 65 20 6f 66 20 | .*...; |size of |
|00005b50| 61 6c 6c 20 74 68 65 20 | 6c 6f 63 61 6c 20 76 61 |all the |local va|
|00005b60| 72 69 61 62 6c 65 73 0d | 09 09 45 4e 44 52 0d 09 |riables.|..ENDR..|
|00005b70| 09 0d 09 09 49 4d 50 4f | 52 54 09 53 65 74 4c 69 |....IMPO|RT.SetLi|
|00005b80| 67 68 74 2c 44 6f 43 6c | 6f 73 65 57 69 6e 64 6f |ght,DoCl|oseWindo|
|00005b90| 77 2c 54 65 72 6d 69 6e | 61 74 65 0d 0d 09 09 57 |w,Termin|ate....W|
|00005ba0| 49 54 48 09 53 74 61 63 | 6b 46 72 61 6d 65 09 09 |ITH.Stac|kFrame..|
|00005bb0| 3b 20 63 6f 76 65 72 20 | 6f 75 72 20 6c 6f 63 61 |; cover |our loca|
|00005bc0| 6c 20 73 74 61 63 6b 20 | 66 72 61 6d 65 0d 09 09 |l stack |frame...|
|00005bd0| 4c 49 4e 4b 09 41 36 2c | 23 4c 6f 63 61 6c 53 69 |LINK.A6,|#LocalSi|
|00005be0| 7a 65 09 09 3b 20 61 6c | 6c 6f 63 61 74 65 20 6f |ze..; al|locate o|
|00005bf0| 75 72 20 6c 6f 63 61 6c | 20 73 74 61 63 6b 20 66 |ur local| stack f|
|00005c00| 72 61 6d 65 0d 0d 09 09 | 4d 4f 56 45 2e 57 09 4d |rame....|MOVE.W.M|
|00005c10| 65 6e 75 49 44 28 41 36 | 29 2c 44 30 09 09 3b 20 |enuID(A6|),D0..; |
|00005c20| 61 20 6e 69 66 74 79 20 | 50 61 73 63 61 6c 20 63 |a nifty |Pascal c|
|00005c30| 61 73 65 2d 6c 69 6b 65 | 20 6d 61 63 72 6f 0d 09 |ase-like| macro..|
|00005c40| 09 43 41 53 45 23 2e 57 | 09 28 44 30 2c 49 46 29 |.CASE#.W|.(D0,IF)|
|00005c50| 2c 09 09 09 5c 0d 09 09 | 09 28 41 70 70 6c 65 4d |,...\...|.(AppleM|
|00005c60| 65 6e 75 2c 09 44 6f 41 | 70 70 6c 65 4d 65 6e 75 |enu,.DoA|ppleMenu|
|00005c70| 29 2c 09 5c 0d 09 09 09 | 28 46 69 6c 65 4d 65 6e |),.\....|(FileMen|
|00005c80| 75 2c 09 44 6f 46 69 6c | 65 4d 65 6e 75 29 2c 09 |u,.DoFil|eMenu),.|
|00005c90| 5c 0d 09 09 09 28 45 64 | 69 74 4d 65 6e 75 2c 09 |\....(Ed|itMenu,.|
|00005ca0| 44 6f 45 64 69 74 4d 65 | 6e 75 29 2c 09 5c 0d 09 |DoEditMe|nu),.\..|
|00005cb0| 09 09 28 4c 69 67 68 74 | 4d 65 6e 75 2c 09 44 6f |..(Light|Menu,.Do|
|00005cc0| 4c 69 67 68 74 4d 65 6e | 75 29 0d 09 09 09 09 09 |LightMen|u)......|
|00005cd0| 09 3b 20 61 64 64 20 61 | 64 64 69 74 69 6f 6e 61 |.; add a|dditiona|
|00005ce0| 6c 20 4d 65 6e 75 73 20 | 77 6f 75 6c 64 20 67 6f |l Menus |would go|
|00005cf0| 20 68 65 72 65 0d 09 09 | 42 52 41 2e 57 09 45 78 | here...|BRA.W.Ex|
|00005d00| 69 74 09 09 09 3b 20 6f | 74 68 65 72 77 69 73 65 |it...; o|therwise|
|00005d10| 20 77 65 20 77 69 6c 6c | 20 65 78 69 74 20 74 68 | we will| exit th|
|00005d20| 69 73 20 70 72 6f 63 65 | 64 75 72 65 0d 0d 2a 20 |is proce|dure..* |
|00005d30| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 20 54 48 |--------|----- TH|
|00005d40| 45 20 41 50 50 4c 45 20 | 4d 45 4e 55 20 52 4f 55 |E APPLE |MENU ROU|
|00005d50| 54 49 4e 45 53 20 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |TINES --|--------|
|00005d60| 2d 2d 2d 0d 44 6f 41 70 | 70 6c 65 4d 65 6e 75 0d |---.DoAp|pleMenu.|
|00005d70| 09 09 43 4d 50 49 2e 57 | 09 23 41 62 6f 75 74 49 |..CMPI.W|.#AboutI|
|00005d80| 74 65 6d 2c 4d 65 6e 75 | 49 74 65 6d 28 41 36 29 |tem,Menu|Item(A6)|
|00005d90| 09 3b 20 77 61 73 20 69 | 74 20 74 68 65 20 61 62 |.; was i|t the ab|
|00005da0| 6f 75 74 20 69 74 65 6d | 3f 0d 09 09 42 4e 45 2e |out item|?...BNE.|
|00005db0| 53 09 40 31 09 09 09 3b | 20 6e 6f 2c 20 6d 75 73 |S.@1...;| no, mus|
|00005dc0| 74 20 62 65 20 61 20 44 | 65 73 6b 20 41 63 63 0d |t be a D|esk Acc.|
|00005dd0| 0d 09 09 43 4c 52 2e 57 | 09 2d 28 53 50 29 09 09 |...CLR.W|.-(SP)..|
|00005de0| 09 3b 20 73 68 6f 77 20 | 74 68 65 20 41 62 6f 75 |.; show |the Abou|
|00005df0| 74 20 64 69 61 6c 6f 67 | 0d 09 09 4d 4f 56 45 2e |t dialog|...MOVE.|
|00005e00| 57 09 23 72 41 62 6f 75 | 74 41 6c 65 72 74 2c 2d |W.#rAbou|tAlert,-|
|00005e10| 28 53 50 29 09 3b 20 72 | 65 73 6f 75 72 63 65 20 |(SP).; r|esource |
|00005e20| 66 6f 72 20 61 6c 65 72 | 74 20 64 69 61 6c 6f 67 |for aler|t dialog|
|00005e30| 0d 09 09 43 4c 52 2e 4c | 09 2d 28 53 50 29 09 09 |...CLR.L|.-(SP)..|
|00005e40| 09 3b 20 6e 6f 20 66 69 | 6c 74 65 72 20 70 72 6f |.; no fi|lter pro|
|00005e50| 63 65 64 75 72 65 20 75 | 73 65 64 20 68 65 72 65 |cedure u|sed here|
|00005e60| 0d 09 09 5f 41 6c 65 72 | 74 09 09 09 09 3b 20 72 |..._Aler|t....; r|
|00005e70| 65 61 64 20 74 68 65 20 | 72 65 73 6f 75 72 63 65 |ead the |resource|
|00005e80| 20 61 6e 64 20 64 69 73 | 70 6c 61 79 20 69 74 0d | and dis|play it.|
|00005e90| 09 09 4d 4f 56 45 2e 57 | 09 28 53 50 29 2b 2c 44 |..MOVE.W|.(SP)+,D|
|00005ea0| 30 09 09 3b 20 49 20 64 | 6f 6e 27 74 20 63 61 72 |0..; I d|on't car|
|00005eb0| 65 20 77 68 69 63 68 20 | 69 74 65 6d 20 69 73 20 |e which |item is |
|00005ec0| 77 61 73 0d 09 09 42 52 | 41 2e 57 09 45 78 69 74 |was...BR|A.W.Exit|
|00005ed0| 09 09 09 3b 20 61 6c 6c | 20 64 6f 6e 65 20 77 69 |...; all| done wi|
|00005ee0| 74 68 20 77 69 74 68 20 | 41 70 70 6c 65 20 6d 65 |th with |Apple me|
|00005ef0| 6e 75 0d 0d 40 31 09 09 | 50 45 41 09 54 65 6d 70 |nu..@1..|PEA.Temp|
|00005f00| 50 6f 72 74 28 41 36 29 | 09 09 3b 20 6f 70 65 6e |Port(A6)|..; open|
|00005f10| 20 61 20 64 65 73 6b 20 | 61 63 63 65 73 73 6f 72 | a desk |accessor|
|00005f20| 79 0d 09 09 5f 47 65 74 | 50 6f 72 74 09 09 09 3b |y..._Get|Port...;|
|00005f30| 20 73 61 76 65 20 74 68 | 65 20 63 75 72 72 65 6e | save th|e curren|
|00005f40| 74 20 70 6f 72 74 0d 09 | 09 43 4c 52 2e 4c 09 2d |t port..|.CLR.L.-|
|00005f50| 28 53 50 29 09 09 09 3b | 20 73 70 61 63 65 20 66 |(SP)...;| space f|
|00005f60| 6f 72 20 72 65 73 75 6c | 74 20 6f 66 20 47 65 74 |or resul|t of Get|
|00005f70| 4d 48 61 6e 64 6c 65 0d | 09 09 4d 4f 56 45 2e 57 |MHandle.|..MOVE.W|
|00005f80| 09 23 41 70 70 6c 65 4d | 65 6e 75 2c 2d 28 53 50 |.#AppleM|enu,-(SP|
|00005f90| 29 0d 09 09 5f 47 65 74 | 4d 48 61 6e 64 6c 65 09 |)..._Get|MHandle.|
|00005fa0| 09 09 3b 20 70 75 74 20 | 41 70 70 6c 65 20 6d 65 |..; put |Apple me|
|00005fb0| 6e 75 20 6f 6e 20 73 74 | 61 63 6b 0d 09 09 4d 4f |nu on st|ack...MO|
|00005fc0| 56 45 2e 57 09 4d 65 6e | 75 49 74 65 6d 28 41 36 |VE.W.Men|uItem(A6|
|00005fd0| 29 2c 2d 28 53 50 29 09 | 3b 20 61 6e 64 20 68 65 |),-(SP).|; and he|
|00005fe0| 72 65 27 73 20 74 68 65 | 20 4d 65 6e 75 49 74 65 |re's the| MenuIte|
|00005ff0| 6d 0d 09 09 50 45 41 09 | 44 65 73 6b 4e 61 6d 65 |m...PEA.|DeskName|
|00006000| 28 41 36 29 09 09 3b 20 | 6e 6f 77 20 74 65 6c 6c |(A6)..; |now tell|
|00006010| 20 6d 65 20 74 68 65 20 | 44 41 27 73 20 6e 61 6d | me the |DA's nam|
|00006020| 65 0d 09 09 5f 47 65 74 | 49 74 65 6d 0d 09 09 43 |e..._Get|Item...C|
|00006030| 4c 52 2e 57 09 2d 28 53 | 50 29 09 09 09 3b 20 73 |LR.W.-(S|P)...; s|
|00006040| 70 61 63 65 20 66 6f 72 | 20 4f 70 65 6e 44 65 73 |pace for| OpenDes|
|00006050| 6b 41 63 63 20 72 65 73 | 75 6c 74 0d 09 09 50 45 |kAcc res|ult...PE|
|00006060| 41 09 44 65 73 6b 4e 61 | 6d 65 28 41 36 29 0d 09 |A.DeskNa|me(A6)..|
|00006070| 09 5f 4f 70 65 6e 44 65 | 73 6b 41 63 63 09 09 09 |._OpenDe|skAcc...|
|00006080| 3b 20 6f 70 65 6e 20 74 | 68 61 74 20 70 75 70 70 |; open t|hat pupp|
|00006090| 79 0d 09 09 4d 4f 56 45 | 2e 57 09 28 53 50 29 2b |y...MOVE|.W.(SP)+|
|000060a0| 2c 44 30 09 09 3b 20 72 | 65 73 75 6c 74 0d 09 09 |,D0..; r|esult...|
|000060b0| 4d 4f 56 45 2e 4c 09 54 | 65 6d 70 50 6f 72 74 28 |MOVE.L.T|empPort(|
|000060c0| 41 36 29 2c 2d 28 53 50 | 29 09 3b 20 72 65 73 74 |A6),-(SP|).; rest|
|000060d0| 6f 72 65 20 74 68 65 20 | 70 6f 72 74 0d 09 09 5f |ore the |port..._|
|000060e0| 53 65 74 50 6f 72 74 0d | 09 09 42 52 41 2e 53 09 |SetPort.|..BRA.S.|
|000060f0| 45 78 69 74 0d 09 09 0d | 2a 20 2d 2d 2d 2d 2d 2d |Exit....|* ------|
|00006100| 2d 2d 2d 2d 2d 2d 2d 20 | 54 48 45 20 46 49 4c 45 |------- |THE FILE|
|00006110| 20 4d 45 4e 55 20 52 4f | 55 54 49 4e 45 53 20 2d | MENU RO|UTINES -|
|00006120| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 0d 44 6f 46 |--------|----.DoF|
|00006130| 69 6c 65 4d 65 6e 75 09 | 0d 09 09 4d 4f 56 45 2e |ileMenu.|...MOVE.|
|00006140| 57 09 4d 65 6e 75 49 74 | 65 6d 28 41 36 29 2c 44 |W.MenuIt|em(A6),D|
|00006150| 30 20 09 3b 20 74 65 73 | 74 20 74 68 65 20 4d 65 |0 .; tes|t the Me|
|00006160| 6e 75 49 74 65 6d 0d 09 | 09 43 61 73 65 23 2e 57 |nuItem..|.Case#.W|
|00006170| 09 28 44 30 2c 49 46 29 | 2c 09 09 09 5c 0d 09 09 |.(D0,IF)|,...\...|
|00006180| 09 28 43 6c 6f 73 65 49 | 74 65 6d 2c 09 46 69 6c |.(CloseI|tem,.Fil|
|00006190| 65 43 6c 6f 73 65 29 2c | 09 5c 0d 09 09 09 28 51 |eClose),|.\....(Q|
|000061a0| 75 69 74 49 74 65 6d 2c | 09 46 69 6c 65 51 75 69 |uitItem,|.FileQui|
|000061b0| 74 29 0d 09 09 42 52 41 | 2e 53 09 45 78 69 74 09 |t)...BRA|.S.Exit.|
|000061c0| 09 09 3b 20 61 64 64 20 | 61 64 64 69 74 69 6f 6e |..; add |addition|
|000061d0| 61 6c 20 6d 65 6e 75 73 | 20 68 65 72 65 0d 46 69 |al menus| here.Fi|
|000061e0| 6c 65 43 6c 6f 73 65 0d | 09 09 43 4c 52 2e 4c 09 |leClose.|..CLR.L.|
|000061f0| 2d 28 53 50 29 09 09 09 | 3b 20 62 75 67 20 66 69 |-(SP)...|; bug fi|
|00006200| 78 2c 20 64 69 64 6e 27 | 74 20 63 6c 65 61 72 20 |x, didn'|t clear |
|00006210| 73 70 61 63 65 20 66 6f | 72 20 72 65 73 75 6c 74 |space fo|r result|
|00006220| 20 2d 4a 44 52 20 32 2f | 32 37 2f 38 39 0d 09 09 | -JDR 2/|27/89...|
|00006230| 5f 46 72 6f 6e 74 57 69 | 6e 64 6f 77 0d 09 09 42 |_FrontWi|ndow...B|
|00006240| 53 52 09 44 6f 43 6c 6f | 73 65 57 69 6e 64 6f 77 |SR.DoClo|seWindow|
|00006250| 09 09 3b 20 63 6c 6f 73 | 65 20 74 68 65 20 77 69 |..; clos|e the wi|
|00006260| 6e 64 6f 77 20 0d 09 09 | 42 52 41 2e 53 09 45 78 |ndow ...|BRA.S.Ex|
|00006270| 69 74 0d 0d 46 69 6c 65 | 51 75 69 74 09 42 53 52 |it..File|Quit.BSR|
|00006280| 09 54 65 72 6d 69 6e 61 | 74 65 09 09 3b 20 6c 65 |.Termina|te..; le|
|00006290| 74 27 73 20 67 65 74 20 | 6f 75 74 20 6f 66 20 68 |t's get |out of h|
|000062a0| 65 72 65 0d 09 09 42 52 | 41 2e 53 09 45 78 69 74 |ere...BR|A.S.Exit|
|000062b0| 09 09 09 3b 20 54 65 72 | 6d 69 6e 61 74 65 20 6d |...; Ter|minate m|
|000062c0| 61 79 20 72 65 74 75 72 | 6e 20 69 66 20 75 73 65 |ay retur|n if use|
|000062d0| 72 20 63 61 6e 63 65 6c | 73 0d 0d 2a 20 2d 2d 2d |r cancel|s..* ---|
|000062e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 20 54 48 45 20 45 |--------|-- THE E|
|000062f0| 44 49 54 20 4d 45 4e 55 | 20 52 4f 55 54 49 4e 45 |DIT MENU| ROUTINE|
|00006300| 53 20 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 0d |S ------|-------.|
|00006310| 44 6f 45 64 69 74 4d 65 | 6e 75 09 0d 09 09 43 4c |DoEditMe|nu....CL|
|00006320| 52 2e 57 09 2d 28 53 50 | 29 09 09 09 3b 20 73 79 |R.W.-(SP|)...; sy|
|00006330| 73 74 65 6d 20 77 69 6c | 6c 20 68 61 6e 64 6c 65 |stem wil|l handle|
|00006340| 20 65 64 69 74 69 6e 67 | 20 6f 66 20 64 65 73 6b | editing| of desk|
|00006350| 20 61 63 63 73 2e 0d 09 | 09 4d 4f 56 45 2e 57 09 | accs...|.MOVE.W.|
|00006360| 4d 65 6e 75 49 74 65 6d | 28 41 36 29 2c 2d 28 53 |MenuItem|(A6),-(S|
|00006370| 50 29 09 3b 20 67 65 74 | 20 74 68 65 20 4d 65 6e |P).; get| the Men|
|00006380| 75 49 74 65 6d 0d 09 09 | 53 55 42 51 2e 57 09 23 |uItem...|SUBQ.W.#|
|00006390| 31 2c 28 53 50 29 09 09 | 09 3b 20 53 79 73 74 65 |1,(SP)..|.; Syste|
|000063a0| 6d 45 64 69 74 20 69 73 | 20 6f 66 66 20 62 79 20 |mEdit is| off by |
|000063b0| 6f 6e 65 0d 09 09 5f 53 | 79 73 45 64 69 74 0d 09 |one..._S|ysEdit..|
|000063c0| 09 4d 4f 56 45 2e 42 09 | 28 53 50 29 2b 2c 44 30 |.MOVE.B.|(SP)+,D0|
|000063d0| 09 09 3b 20 64 72 6f 70 | 20 72 65 73 75 6c 74 20 |..; drop| result |
|000063e0| 66 72 6f 6d 20 53 79 73 | 74 65 6d 45 64 69 74 0d |from Sys|temEdit.|
|000063f0| 09 09 42 52 41 2e 53 09 | 45 78 69 74 09 09 09 3b |..BRA.S.|Exit...;|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.